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:
parent
b0bfb92831
commit
71301d1824
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue