summaryrefslogtreecommitdiff
path: root/test/test-common.sh
diff options
context:
space:
mode:
Diffstat (limited to 'test/test-common.sh')
-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 "$@"
)