aboutsummaryrefslogtreecommitdiff
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.sh43
1 files changed, 33 insertions, 10 deletions
diff --git a/t/t0061-run-command.sh b/t/t0061-run-command.sh
index 76d4936a87..60cfe65979 100755
--- a/t/t0061-run-command.sh
+++ b/t/t0061-run-command.sh
@@ -164,6 +164,37 @@ test_expect_success 'run_command runs ungrouped in parallel with more tasks than
test_line_count = 4 err
'
+test_expect_success 'run_command listens to stdin' '
+ cat >expect <<-\EOF &&
+ preloaded output of a child
+ listening for stdin:
+ sample stdin 1
+ sample stdin 0
+ preloaded output of a child
+ listening for stdin:
+ sample stdin 1
+ sample stdin 0
+ preloaded output of a child
+ listening for stdin:
+ sample stdin 1
+ sample stdin 0
+ preloaded output of a child
+ listening for stdin:
+ sample stdin 1
+ sample stdin 0
+ EOF
+
+ write_script stdin-script <<-\EOF &&
+ echo "listening for stdin:"
+ while read line
+ do
+ echo "$line"
+ done
+ EOF
+ test-tool run-command run-command-stdin 2 ./stdin-script 2>actual &&
+ test_cmp expect actual
+'
+
cat >expect <<-EOF
preloaded output of a child
asking for a quick stop
@@ -256,16 +287,8 @@ test_expect_success MINGW 'can spawn .bat with argv[0] containing spaces' '
rm -f out &&
echo "echo %* >>out" >"$bat" &&
- # Ask git to invoke .bat; clone will fail due to fake SSH helper
- test_must_fail env GIT_SSH="$bat" git clone myhost:src ssh-clone &&
-
- # Spawning .bat can fail if there are two quoted cmd.exe arguments.
- # .bat itself is first (due to spaces in name), so just one more is
- # needed to verify. GIT_SSH will invoke .bat multiple times:
- # 1) -G myhost
- # 2) myhost "git-upload-pack src"
- # First invocation will always succeed. Test the second one.
- grep "git-upload-pack" out
+ test-tool run-command run-command "$bat" "arg with spaces" &&
+ test_grep "arg with spaces" out
'
test_done