summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2018-03-08 12:36:27 -0800
committerLibravatar Junio C Hamano <gitster@pobox.com>2018-03-08 12:36:28 -0800
commita8d45dcfc075ada5d624b43e2b365cbcde564779 (patch)
treef924db91d1077a722ddf4a36957f2c8dd251a778 /t
parentMerge branch 'ds/mark-parents-uninteresting-optim' (diff)
parenttest_must_be_empty: make sure the file exists, not just empty (diff)
downloadtgif-a8d45dcfc075ada5d624b43e2b365cbcde564779.tar.xz
Merge branch 'jc/test-must-be-empty'
Test framework tweak to catch developer thinko. * jc/test-must-be-empty: test_must_be_empty: make sure the file exists, not just empty
Diffstat (limited to 't')
-rw-r--r--t/test-lib-functions.sh6
1 files changed, 5 insertions, 1 deletions
diff --git a/t/test-lib-functions.sh b/t/test-lib-functions.sh
index 42a6781358..6e342804f9 100644
--- a/t/test-lib-functions.sh
+++ b/t/test-lib-functions.sh
@@ -782,7 +782,11 @@ verbose () {
# otherwise.
test_must_be_empty () {
- if test -s "$1"
+ if ! test -f "$1"
+ then
+ echo "'$1' is missing"
+ return 1
+ elif test -s "$1"
then
echo "'$1' is not empty, it contains:"
cat "$1"