tests/libtest.sh: Print non-matching file on failure

We clean up the temporary directory on failure, which means it's hard
to know *why* a regex didn't match.  Print it when we hit an error.

Closes: #383
Approved by: mbarnes
This commit is contained in:
Colin Walters authored and Atomic Bot committed 2016-07-08 18:38:11 +00:00
1 parent b0bfb92831
commit 71301d1824
1 file changed
+1
+1
View File
@@ -138,6 +138,7 @@ assert_file_has_content () {
if ! grep -q -e "$2" "$1"; then
sed -e 's/^/# /' < "$1" >&2
echo 1>&2 "File '$1' doesn't match regexp '$2'"
cat $1
exit 1
fi
}