diff --git a/tests/misc/env-S-script.sh b/tests/misc/env-S-script.sh old mode 100644 new mode 100755 index 0377191..d164be5 --- a/tests/misc/env-S-script.sh +++ b/tests/misc/env-S-script.sh @@ -37,12 +37,11 @@ chmod a+x env_test || framework_failure_ # support multiple arguments on the shebang line. # Ignoring the absolute paths, the script is: # #!env printf x%sx\n A B -printf "#!$dir/env $dir/printf "'x%%sx\\n A B\n' > env_bad || framework_failure_ +printf "#!$dir/env $dir/printf "'x%%sx\\n A B\n' > env_bad || + framework_failure_ chmod a+x env_bad || framework_failure_ -returns_ 127 ./env_bad \ - || warn_ "WARNING: OS natively accepts multiple arguments on shebang line" - - +returns_ 127 ./env_bad || + warn_ 'Note: OS natively accepts multiple arguments on shebang line' # env should execute 'printf' with 7 parameters: # 'x%sx\n', 'A', 'B' from the "-S" argument, @@ -51,7 +50,7 @@ returns_ 127 ./env_bad \ # #!env -S printf x%sx\n A B printf "#!$dir/env -S $dir/printf "'x%%sx\\n A B\n' > env1 || framework_failure_ chmod a+x env1 || framework_failure_ -cat<exp1 || framework_failure_ +cat<<\EOF>exp1 || framework_failure_ xAx xBx x./env1x @@ -67,10 +66,10 @@ compare exp1 out1 || fail=1 # 'A B' and not two paramaters 'A','B'. # Ignoring the absolute paths, the script is: # #!env -S printf x%sx\n "A B" -printf "#!$dir/env -S $dir/printf "'x%%sx\\n "A B"\n' > env2 \ - || framework_failure_ +printf "#!$dir/env -S $dir/printf "'x%%sx\\n "A B"\n' > env2 || + framework_failure_ chmod a+x env2 || framework_failure_ -cat<exp2 || framework_failure_ +cat<<\EOF>exp2 || framework_failure_ xA Bx x./env2x EOF @@ -81,9 +80,10 @@ compare exp2 out2 || fail=1 # backslash-underscore instead of spaces. # Ignoring the absolute paths, the script is: # #!env -Sprintf\_x%sx\n\_Y -printf "#!$dir/env -S$dir/printf"'\\_x%%sx\\n\\_Y\n' > env3 || framework_failure_ +printf "#!$dir/env -S$dir/printf"'\\_x%%sx\\n\\_Y\n' > env3 || + framework_failure_ chmod a+x env3 || framework_failure_ -cat<exp3 || framework_failure_ +cat<<\EOF>exp3 || framework_failure_ xYx x./env3x xWx @@ -99,7 +99,7 @@ compare exp3 out3 || fail=1 printf "#!$dir/env -S$dir/printf"' x%%sx\\n A#B #C D\n' > env4 \ || framework_failure_ chmod a+x env4 || framework_failure_ -cat<exp4 || framework_failure_ +cat<<\EOF>exp4 || framework_failure_ xA#Bx x./env4x xZx @@ -116,7 +116,7 @@ compare exp4 out4 || fail=1 { printf "#!$dir/env -S perl -w -T\n" ; printf 'print "hello\\n";\n' ; } > env5 || framework_failure_ chmod a+x env5 || framework_failure_ -cat<exp5 || framework_failure_ +cat<<\EOF>exp5 || framework_failure_ hello EOF ./env5 > out5 || fail=1 @@ -138,7 +138,4 @@ printf "env6" > exp6 || framework_failure_ compare exp6 out6 || fail=1 - - - Exit $fail