@matheusbsbs / matheus-bagliano / commits / 99c049bc4c
Fork 0

t0003: use test_must_be_empty()

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>

Denton Liu committed Dec 20, 2019 at 10:15 UTC 99c049bc4c029471af5efcbd1a4ca1fd4a45b923
1 file changed +3 -3
t/t0003-attributes.sh
+3 -3
@@ -10,7 +10,7 @@ attr_check () {
10 git $git_opts check-attr test -- "$path" >actual 2>err &&
11 echo "$path: test: $expect" >expect &&
12 test_cmp expect actual &&
13 - test_line_count = 0 err
13 + test_must_be_empty err
14 }
15
16 attr_check_quote () {
@@ -241,7 +241,7 @@ EOF
241 git check-attr foo -- "a/b/f" >>actual 2>>err &&
242 git check-attr foo -- "a/b/c/f" >>actual 2>>err &&
243 test_cmp expect actual &&
244 - test_line_count = 0 err
244 + test_must_be_empty err
245 '
246
247 test_expect_success '"**" with no slashes test' '
@@ -262,7 +262,7 @@ EOF
262 git check-attr foo -- "a/b/f" >>actual 2>>err &&
263 git check-attr foo -- "a/b/c/f" >>actual 2>>err &&
264 test_cmp expect actual &&
265 - test_line_count = 0 err
265 + test_must_be_empty err
266 '
267
268 test_expect_success 'using --git-dir and --work-tree' '