diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/test-common.sh | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/test/test-common.sh b/test/test-common.sh index 5c238e1..7dd8128 100644 --- a/test/test-common.sh +++ b/test/test-common.sh @@ -95,13 +95,17 @@ require() ( return 0 ) -empty() ( - set +x - [[ $(stat -c %s "$1") -eq 0 ]] -) +empty() { + diff -u /dev/null "$1" +} # Just using '!' doesn't trip `set -e` not() ( set +x + # we don't care about what is in the file on 'not empty' + # checks, so redefine 'empty' to be a bit quieter. + empty() { + [[ $(stat -c %s "$1") -eq 0 ]] + } ! eval "$@" ) |