Skip to content

Commit c93a5aa

Browse files
rscharfegitster
authored andcommitted
t1400: use test_must_be_empty
Use test_must_be_empty instead of reading the file and comparing its contents to an empty string. 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. Signed-off-by: René Scharfe <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 6e4826e commit c93a5aa

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

t/t1400-update-ref.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -378,13 +378,13 @@ test_expect_success 'Query "master@{May 26 2005 23:32:00}" (exactly history star
378378
test_when_finished "rm -f o e" &&
379379
git rev-parse --verify "master@{May 26 2005 23:32:00}" >o 2>e &&
380380
test $C = $(cat o) &&
381-
test "" = "$(cat e)"
381+
test_must_be_empty e
382382
'
383383
test_expect_success 'Query "master@{May 26 2005 23:32:30}" (first non-creation change)' '
384384
test_when_finished "rm -f o e" &&
385385
git rev-parse --verify "master@{May 26 2005 23:32:30}" >o 2>e &&
386386
test $A = $(cat o) &&
387-
test "" = "$(cat e)"
387+
test_must_be_empty e
388388
'
389389
test_expect_success 'Query "master@{2005-05-26 23:33:01}" (middle of history with gap)' '
390390
test_when_finished "rm -f o e" &&
@@ -396,13 +396,13 @@ test_expect_success 'Query "master@{2005-05-26 23:38:00}" (middle of history)' '
396396
test_when_finished "rm -f o e" &&
397397
git rev-parse --verify "master@{2005-05-26 23:38:00}" >o 2>e &&
398398
test $Z = $(cat o) &&
399-
test "" = "$(cat e)"
399+
test_must_be_empty e
400400
'
401401
test_expect_success 'Query "master@{2005-05-26 23:43:00}" (exact end of history)' '
402402
test_when_finished "rm -f o e" &&
403403
git rev-parse --verify "master@{2005-05-26 23:43:00}" >o 2>e &&
404404
test $E = $(cat o) &&
405-
test "" = "$(cat e)"
405+
test_must_be_empty e
406406
'
407407
test_expect_success 'Query "master@{2005-05-28}" (past end of history)' '
408408
test_when_finished "rm -f o e" &&

0 commit comments

Comments
 (0)