diff-parseopt: restore -U (no argument) behavior
[gitweb.git] / t / t0061-run-command.sh
index 8a484878ec8a95f2f72b768056663b971f19f1b5..99a614bc7c45ca792c7bbce7d16f793ab6107896 100755 (executable)
@@ -11,7 +11,6 @@ cat >hello-script <<-EOF
        #!$SHELL_PATH
        cat hello-script
 EOF
->empty
 
 test_expect_success 'start_command reports ENOENT (slash)' '
        test-tool run-command start-command-ENOENT ./does-not-exist 2>err &&
@@ -29,10 +28,18 @@ test_expect_success 'run_command can run a command' '
        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' '
+
+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
@@ -48,7 +55,7 @@ test_expect_success !MINGW 'run_command can run a script without a #! line' '
        test-tool run-command run-command ./hello >actual 2>err &&
 
        test_cmp hello-script actual &&
-       test_cmp empty err
+       test_must_be_empty err
 '
 
 test_expect_success 'run_command does not try to execute a directory' '
@@ -61,7 +68,7 @@ test_expect_success 'run_command does not try to execute a directory' '
        PATH=$PWD/bin1:$PWD/bin2:$PATH \
                test-tool run-command run-command greet >actual 2>err &&
        test_cmp bin2/greet actual &&
-       test_cmp empty err
+       test_must_be_empty err
 '
 
 test_expect_success POSIXPERM 'run_command passes over non-executable file' '
@@ -78,7 +85,7 @@ test_expect_success POSIXPERM 'run_command passes over non-executable file' '
        PATH=$PWD/bin1:$PWD/bin2:$PATH \
                test-tool run-command run-command greet >actual 2>err &&
        test_cmp bin2/greet actual &&
-       test_cmp empty err
+       test_must_be_empty err
 '
 
 test_expect_success POSIXPERM 'run_command reports EACCES' '