From 8d731b26bfc345e517e9d76d9d4ebcbcd233aca3 Mon Sep 17 00:00:00 2001 From: XUANHE ZHOU Date: Mon, 29 Jun 2020 20:51:20 -0700 Subject: [PATCH] use contains instead of regex --- misc/test/examples_test.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/misc/test/examples_test.go b/misc/test/examples_test.go index 58325bcf5..740a37a51 100644 --- a/misc/test/examples_test.go +++ b/misc/test/examples_test.go @@ -9,7 +9,6 @@ import ( "net/http" "os" "path" - "regexp" "strings" "testing" "time" @@ -253,7 +252,7 @@ func TestAccAwsPyServerlessRaw(t *testing.T) { Dir: path.Join(getCwd(t), "..", "..", "aws-py-serverless-raw"), ExtraRuntimeValidation: func(t *testing.T, stack integration.RuntimeValidationStackInfo) { assertHTTPResult(t, stack.Outputs["endpoint"].(string)+"/hello", nil, func(body string) bool { - return assert.Regexp(t, regexp.MustCompile("{\"Path\":\"hello\",\"Count\":[0-9]+}"), body) + return assert.Contains(t, body, "{\"Path\":\"hello\",\"Count\":1}") }) }, }) @@ -497,7 +496,7 @@ func TestAccAwsTsServerlessRaw(t *testing.T) { Dir: path.Join(getCwd(t), "..", "..", "aws-ts-serverless-raw"), ExtraRuntimeValidation: func(t *testing.T, stack integration.RuntimeValidationStackInfo) { assertHTTPResult(t, stack.Outputs["endpoint"].(string)+"/hello", nil, func(body string) bool { - return assert.Regexp(t, regexp.MustCompile("{\"Path\":\"hello\",\"Count\":[0-9]+}"), body) + return assert.Contains(t, body, "{\"Path\":\"hello\",\"Count\":1}") }) }, })