diff --git a/test/utils b/test/utils
index d15387192942d4b4cef9429d27faf0821bacb24b..2332c708f38131fb51947f340a331c381e4dbdc8 100644
--- a/test/utils
+++ b/test/utils
@@ -150,6 +150,11 @@ _assertContains()
     esac
 
     fail "${msg:-${default_msg}}"
+
+    if [ "${haystack_type}" == "file" ]; then
+      echo
+      cat "${haystack}"
+    fi
   fi
 }