@@ -36,6 +36,34 @@ def test_single_marker():
3636 assert m .constraint_string == "not in 2.7, 3.0, 3.1"
3737 assert str (m .constraint ) == "<2.7.0 || >=2.8.0,<3.0.0 || >=3.2.0"
3838
39+ m = parse_marker (
40+ "platform_machine in 'x86_64 X86_64 aarch64 AARCH64 ppc64le PPC64LE amd64 AMD64 win32 WIN32'"
41+ )
42+
43+ assert isinstance (m , SingleMarker )
44+ assert m .name == "platform_machine"
45+ assert (
46+ m .constraint_string
47+ == "in x86_64 X86_64 aarch64 AARCH64 ppc64le PPC64LE amd64 AMD64 win32 WIN32"
48+ )
49+ assert str (m .constraint ) == (
50+ "x86_64 || X86_64 || aarch64 || AARCH64 || ppc64le || PPC64LE || amd64 || AMD64 || win32 || WIN32"
51+ )
52+
53+ m = parse_marker (
54+ "platform_machine not in 'x86_64 X86_64 aarch64 AARCH64 ppc64le PPC64LE amd64 AMD64 win32 WIN32'"
55+ )
56+
57+ assert isinstance (m , SingleMarker )
58+ assert m .name == "platform_machine"
59+ assert (
60+ m .constraint_string
61+ == "not in x86_64 X86_64 aarch64 AARCH64 ppc64le PPC64LE amd64 AMD64 win32 WIN32"
62+ )
63+ assert str (m .constraint ) == (
64+ "!=x86_64, !=X86_64, !=aarch64, !=AARCH64, !=ppc64le, !=PPC64LE, !=amd64, !=AMD64, !=win32, !=WIN32"
65+ )
66+
3967
4068def test_single_marker_intersect ():
4169 m = parse_marker ('sys_platform == "darwin"' )
@@ -476,6 +504,26 @@ def test_multi_marker_removes_duplicates():
476504 {"python_version" : "2.7" },
477505 False ,
478506 ),
507+ (
508+ "platform_machine in 'x86_64 X86_64 aarch64 AARCH64 ppc64le PPC64LE amd64 AMD64 win32 WIN32'" ,
509+ {"platform_machine" : "foo" },
510+ False ,
511+ ),
512+ (
513+ "platform_machine in 'x86_64 X86_64 aarch64 AARCH64 ppc64le PPC64LE amd64 AMD64 win32 WIN32'" ,
514+ {"platform_machine" : "x86_64" },
515+ True ,
516+ ),
517+ (
518+ "platform_machine not in 'x86_64 X86_64 aarch64 AARCH64 ppc64le PPC64LE amd64 AMD64 win32 WIN32'" ,
519+ {"platform_machine" : "foo" },
520+ True ,
521+ ),
522+ (
523+ "platform_machine not in 'x86_64 X86_64 aarch64 AARCH64 ppc64le PPC64LE amd64 AMD64 win32 WIN32'" ,
524+ {"platform_machine" : "x86_64" },
525+ False ,
526+ ),
479527 ],
480528)
481529def test_validate (marker_string , environment , expected ):
0 commit comments