t3700-add: fix dependence on stdout and stderr buffering
One test case checked the stdout and stderr of 'git add' by constructing a single 'expect' file that contained both streams. But when the command runs, the order of stdout and stderr output is unpredictable because it depends on how the streams are buffered. At least on Windows, the buffering is different from what the test case expected. Hence, check the two output texts separately. Signed-off-by: Johannes Sixt <j6t@kdbg.org> Acked-by: Jens Lehmann <Jens.Lehmann@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Johannes Sixt committed
Jul 22, 2010 at 10:13 UTC
c1e02b2b383a6cd29353067c942384028745314c
1 file changed
+6
-3
t/t3700-add.sh
+6
-3
@@ -272,17 +272,20 @@ test_expect_success 'git add --dry-run of non-existing file' "
272
echo \"fatal: pathspec 'ignored-file' did not match any files\" | test_cmp - actual
273
"
274
275
-cat >expect <<EOF
275
+cat >expect.err <<\EOF
276
The following paths are ignored by one of your .gitignore files:
277
ignored-file
278
Use -f if you really want to add them.
279
fatal: no files added
280
+EOF
281
+cat >expect.out <<\EOF
282
add 'track-this'
283
EOF
284
285
test_expect_success 'git add --dry-run --ignore-missing of non-existing file' '
284
- test_must_fail git add --dry-run --ignore-missing track-this ignored-file >actual 2>&1 &&
285
- test_cmp expect actual
286
+ test_must_fail git add --dry-run --ignore-missing track-this ignored-file >actual.out 2>actual.err &&
287
+ test_cmp expect.out actual.out &&
288
+ test_cmp expect.err actual.err
289
'
290
291
test_done