@@ -516,6 +516,30 @@ def test_py3_shebang(self):
516
516
self .assertEqual ("3.100-arm64" , data ["SearchInfo.tag" ])
517
517
self .assertEqual (f"X.Y-arm64.exe -X fake_arg_for_test -prearg { script } -postarg" , data ["stdout" ].strip ())
518
518
519
+ def test_py_shebang_nl (self ):
520
+ with self .py_ini (TEST_PY_COMMANDS ):
521
+ with self .script ("#! /usr/bin/env python -prearg\n " ) as script :
522
+ data = self .run_py ([script , "-postarg" ])
523
+ self .assertEqual ("PythonTestSuite" , data ["SearchInfo.company" ])
524
+ self .assertEqual ("3.100" , data ["SearchInfo.tag" ])
525
+ self .assertEqual (f"X.Y.exe -prearg { script } -postarg" , data ["stdout" ].strip ())
526
+
527
+ def test_py2_shebang_nl (self ):
528
+ with self .py_ini (TEST_PY_COMMANDS ):
529
+ with self .script ("#! /usr/bin/env python2 -prearg\n " ) as script :
530
+ data = self .run_py ([script , "-postarg" ])
531
+ self .assertEqual ("PythonTestSuite" , data ["SearchInfo.company" ])
532
+ self .assertEqual ("3.100-32" , data ["SearchInfo.tag" ])
533
+ self .assertEqual (f"X.Y-32.exe -prearg { script } -postarg" , data ["stdout" ].strip ())
534
+
535
+ def test_py3_shebang_nl (self ):
536
+ with self .py_ini (TEST_PY_COMMANDS ):
537
+ with self .script ("#! /usr/bin/env python3 -prearg\n " ) as script :
538
+ data = self .run_py ([script , "-postarg" ])
539
+ self .assertEqual ("PythonTestSuite" , data ["SearchInfo.company" ])
540
+ self .assertEqual ("3.100-arm64" , data ["SearchInfo.tag" ])
541
+ self .assertEqual (f"X.Y-arm64.exe -X fake_arg_for_test -prearg { script } -postarg" , data ["stdout" ].strip ())
542
+
519
543
def test_install (self ):
520
544
data = self .run_py (["-V:3.10" ], env = {"PYLAUNCHER_ALWAYS_INSTALL" : "1" }, expect_returncode = 111 )
521
545
cmd = data ["stdout" ].strip ()
0 commit comments