match-trees: use hashcpy to splice trees
[gitweb.git] / t / t0061-run-command.sh
index 3e131c5325e363fa6188456e3f5f3f47f762801e..96bf6d6a7d0145334666fcd15373bad6ac66fd67 100755 (executable)
@@ -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,14 @@ test_expect_success 'run_command can run a command' '
        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 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