summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2018-03-08 20:36:27 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-03-08 20:36:28 (GMT)
commita8d45dcfc075ada5d624b43e2b365cbcde564779 (patch)
treef924db91d1077a722ddf4a36957f2c8dd251a778 /t
parentd5120daba4f91c97fb9eb77e32f0f9e009bb515a (diff)
parent11395a3b4b16d9fc637ca2e41a6892ea2e6289ce (diff)
downloadgit-a8d45dcfc075ada5d624b43e2b365cbcde564779.zip
git-a8d45dcfc075ada5d624b43e2b365cbcde564779.tar.gz
git-a8d45dcfc075ada5d624b43e2b365cbcde564779.tar.bz2
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 42a6781..6e34280 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"