#!$SHELL_PATH
cat hello-script
EOF
->empty
- test_expect_success 'start_command reports ENOENT' '
+ test_expect_success 'start_command reports ENOENT (slash)' '
test-tool run-command start-command-ENOENT ./does-not-exist
'
test-tool run-command run-command ./hello.sh >actual 2>err &&
test_cmp hello-script actual &&
- test_cmp empty err
+ test_must_be_empty err
'
+ test_expect_success 'run_command is restricted to PATH' '
+ write_script should-not-run <<-\EOF &&
+ echo yikes
+ EOF
+ test_must_fail test-tool run-command run-command should-not-run
+ '
+
test_expect_success !MINGW 'run_command can run a script without a #! line' '
cat >hello <<-\EOF &&
cat hello-script