Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2018-03-08 23:36:27 +0300
committerJunio C Hamano <gitster@pobox.com>2018-03-08 23:36:28 +0300
commita8d45dcfc075ada5d624b43e2b365cbcde564779 (patch)
treef924db91d1077a722ddf4a36957f2c8dd251a778 /t
parentd5120daba4f91c97fb9eb77e32f0f9e009bb515a (diff)
parent11395a3b4b16d9fc637ca2e41a6892ea2e6289ce (diff)
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"