t8001: check the exit status of the command being tested
Avoid running the command being tested as an upstream of a pipe; doing so will lose its exit status. While at it, modernise the style of the script. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano committed
Mar 30, 2011 at 12:22 UTC
4b705f4052432906f0acbb22b25254eb3917e36c
1 file changed
+6
-5
t/t8001-annotate.sh
+6
-5
@@ -6,10 +6,11 @@ test_description='git annotate'
6
PROG='git annotate'
7
. "$TEST_DIRECTORY"/annotate-tests.sh
8
9
-test_expect_success \
10
- 'Annotating an old revision works' \
11
- '[ $(git annotate file master | awk "{print \$3}" | grep -c "^A$") -eq 2 ] && \
12
- [ $(git annotate file master | awk "{print \$3}" | grep -c "^B$") -eq 2 ]'
13
-
9
+test_expect_success 'Annotating an old revision works' '
10
+ git annotate file master >result &&
11
+ awk "{ print \$3; }" <result >authors &&
12
+ test 2 = $(grep A <authors | wc -l) &&
13
+ test 2 = $(grep B <authors | wc -l)
14
+'
15
16
test_done