summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2017-05-24 00:02:22 -0400
committerLuke Shumaker <lukeshu@lukeshu.com>2017-05-24 00:02:22 -0400
commit7d862c0bb25e2bbcb6973024556734019014e588 (patch)
tree44c26e94ccd202926ce2e72261523be7daf8010e /test
parentd5872b7bae380edfee91565073840e6ab4adc626 (diff)
test: have 'empty' checks be a bit more verbose
Diffstat (limited to 'test')
-rw-r--r--test/test-common.sh12
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 "$@"
)