@matheusbsbs / matheus-bagliano / commits / ed254710ee
Fork 0

test: use test_must_be_empty F instead of test_cmp empty F

Use test_must_be_empty instead of comparing it to an empty file. That's more efficient, as the function only needs built-in meta-data only check in the usual case, and provides nicer debug output otherwise. Helped-by: Denton Liu <liu.denton@gmail.com> Signed-off-by: René Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>

René Scharfe committed Nov 27, 2019 at 08:51 UTC ed254710eee0a5fcde1057593d181d40b02922e1
2 files changed +2 -5
t/t1011-read-tree-sparse-checkout.sh
+1 -2
@@ -215,7 +215,6 @@ test_expect_success 'read-tree adds to worktree, dirty case' '
215 '
216
217 test_expect_success 'index removal and worktree narrowing at the same time' '
218 - >empty &&
218 echo init.t >.git/info/sparse-checkout &&
219 echo sub/added >>.git/info/sparse-checkout &&
220 git checkout -f top &&
@@ -223,7 +222,7 @@ test_expect_success 'index removal and worktree narrowing at the same time' '
222 git checkout removed &&
223 git ls-files sub/added >result &&
224 test ! -f sub/added &&
226 - test_cmp empty result
225 + test_must_be_empty result
226 '
227
228 test_expect_success 'read-tree --reset removes outside worktree' '
t/t9010-svn-fe.sh
+1 -3
@@ -53,8 +53,6 @@ text_no_props () {
53 printf "%s\n" "$text"
54 }
55
56 ->empty
57 -
56 test_expect_success 'empty dump' '
57 reinit_git &&
58 echo "SVN-fs-dump-format-version: 2" >input &&
@@ -208,7 +206,7 @@ test_expect_failure 'timestamp and empty file' '
206 test_cmp expect.date actual.date &&
207 test_cmp expect.files actual.files &&
208 git checkout HEAD empty-file &&
211 - test_cmp empty file
209 + test_must_be_empty file
210 '
211
212 test_expect_success 'directory with files' '