summaryrefslogtreecommitdiff
path: root/t/t0061-run-command.sh
diff options
context:
space:
mode:
Diffstat (limited to 't/t0061-run-command.sh')
-rwxr-xr-xt/t0061-run-command.sh26
1 files changed, 24 insertions, 2 deletions
diff --git a/t/t0061-run-command.sh b/t/t0061-run-command.sh
index 3e131c5325..99a614bc7c 100755
--- a/t/t0061-run-command.sh
+++ b/t/t0061-run-command.sh
@@ -12,8 +12,14 @@ cat >hello-script <<-EOF
cat hello-script
EOF
-test_expect_success 'start_command reports ENOENT' '
- test-tool run-command start-command-ENOENT ./does-not-exist
+test_expect_success 'start_command reports ENOENT (slash)' '
+ test-tool run-command start-command-ENOENT ./does-not-exist 2>err &&
+ test_i18ngrep "\./does-not-exist" err
+'
+
+test_expect_success 'start_command reports ENOENT (no slash)' '
+ test-tool run-command start-command-ENOENT does-not-exist 2>err &&
+ test_i18ngrep "does-not-exist" err
'
test_expect_success 'run_command can run a command' '
@@ -25,6 +31,22 @@ test_expect_success 'run_command can run a command' '
test_must_be_empty err
'
+
+test_lazy_prereq RUNS_COMMANDS_FROM_PWD '
+ write_script runs-commands-from-pwd <<-\EOF &&
+ true
+ EOF
+ runs-commands-from-pwd >/dev/null 2>&1
+'
+
+test_expect_success !RUNS_COMMANDS_FROM_PWD '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 2>err &&
+ test_i18ngrep "should-not-run" err
+'
+
test_expect_success !MINGW 'run_command can run a script without a #! line' '
cat >hello <<-\EOF &&
cat hello-script