]> git.ipfire.org Git - thirdparty/git.git/commitdiff
t3600: use test_line_count() where possible
authorDenton Liu <liu.denton@gmail.com>
Wed, 27 Nov 2019 19:53:16 +0000 (11:53 -0800)
committerJunio C Hamano <gitster@pobox.com>
Fri, 29 Nov 2019 21:20:14 +0000 (13:20 -0800)
Since we have a helper function that can test the number of lines in a
file that gives better debugging information on failure, use
test_line_count() to test the number of lines.

Signed-off-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t3600-rm.sh

index 8c8cca5bfb1eaff0474e4bc8bca423ba503a633c..f6e659b7e97a529960c589d6c64080b68a145db4 100755 (executable)
@@ -113,9 +113,10 @@ test_expect_success '"rm" command printed' '
        echo frotz >test-file &&
        git add test-file &&
        git commit -m "add file for rm test" &&
-       git rm test-file >rm-output &&
-       test $(grep "^rm " rm-output | wc -l) = 1 &&
-       rm -f test-file rm-output &&
+       git rm test-file >rm-output.raw &&
+       grep "^rm " rm-output.raw >rm-output &&
+       test_line_count = 1 rm-output &&
+       rm -f test-file rm-output.raw rm-output &&
        git commit -m "remove file from rm test"
 '