Skip to content

Commit a8d45dc

Browse files
committed
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
2 parents d5120da + 11395a3 commit a8d45dc

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

t/test-lib-functions.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -782,7 +782,11 @@ verbose () {
782782
# otherwise.
783783

784784
test_must_be_empty () {
785-
if test -s "$1"
785+
if ! test -f "$1"
786+
then
787+
echo "'$1' is missing"
788+
return 1
789+
elif test -s "$1"
786790
then
787791
echo "'$1' is not empty, it contains:"
788792
cat "$1"

0 commit comments

Comments
 (0)