]> git.ipfire.org Git - thirdparty/git.git/commitdiff
t0003: use test_must_be_empty()
authorDenton Liu <liu.denton@gmail.com>
Fri, 20 Dec 2019 18:15:51 +0000 (10:15 -0800)
committerJunio C Hamano <gitster@pobox.com>
Fri, 20 Dec 2019 19:30:44 +0000 (11:30 -0800)
In several places, we used `test_line_count = 0` to check for an empty
file. Although this is correct, it's overkill. Use test_must_be_empty()
instead because it's more suited for this purpose.

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

index 3569bef75dbedc3a3102dd198d70109be6b56fe2..c30c736d3f0100a8bd8921211a9006f703a1f53e 100755 (executable)
@@ -10,7 +10,7 @@ attr_check () {
        git $git_opts check-attr test -- "$path" >actual 2>err &&
        echo "$path: test: $expect" >expect &&
        test_cmp expect actual &&
-       test_line_count = 0 err
+       test_must_be_empty err
 }
 
 attr_check_quote () {
@@ -241,7 +241,7 @@ EOF
        git check-attr foo -- "a/b/f" >>actual 2>>err &&
        git check-attr foo -- "a/b/c/f" >>actual 2>>err &&
        test_cmp expect actual &&
-       test_line_count = 0 err
+       test_must_be_empty err
 '
 
 test_expect_success '"**" with no slashes test' '
@@ -262,7 +262,7 @@ EOF
        git check-attr foo -- "a/b/f" >>actual 2>>err &&
        git check-attr foo -- "a/b/c/f" >>actual 2>>err &&
        test_cmp expect actual &&
-       test_line_count = 0 err
+       test_must_be_empty err
 '
 
 test_expect_success 'using --git-dir and --work-tree' '