From 71301d18244a3a26a6ba6fd3934633ef94811a15 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Thu, 7 Jul 2016 17:36:08 -0400 Subject: [PATCH] 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 --- tests/libtest.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/libtest.sh b/tests/libtest.sh index 2d064299..e93b9510 100755 --- a/tests/libtest.sh +++ b/tests/libtest.sh @@ -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 }