From 32c05d9920d7b6e64b2499bf6b97af9937a81202 Mon Sep 17 00:00:00 2001 From: Frank Mueller Date: Sun, 14 Nov 2021 22:08:00 +0100 Subject: [PATCH] Fix info in failing web body tests --- environments/web.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/environments/web.go b/environments/web.go index 7d3ec01..e1c3a0a 100644 --- a/environments/web.go +++ b/environments/web.go @@ -207,9 +207,10 @@ func (wresp *WebResponse) AssertUnmarshalledBody(data interface{}) { func (wresp *WebResponse) AssertBodyMatches(pattern string) { restore := wresp.wa.assert.IncrCallstackOffset() defer restore() - ok, err := regexp.MatchString(pattern, string(wresp.body)) + body := string(wresp.body) + ok, err := regexp.MatchString(pattern, body) wresp.wa.assert.Nil(err, "illegal content match pattern") - wresp.wa.assert.True(ok, "body doesn't match pattern") + wresp.wa.assert.True(ok, "body doesn't match pattern", body) } // AssertBodyGrep greps content out of the body.