hs-test: fix broken test 68/42268/4
authorMatus Fabian <[email protected]>
Thu, 30 Jan 2025 09:36:14 +0000 (04:36 -0500)
committerDave Wallace <[email protected]>
Thu, 30 Jan 2025 17:13:52 +0000 (17:13 +0000)
AssertContains and AssertNotContains are now case insensitive to
prevent issues like in HttpPersistentConnectionTest.

Type: test

Change-Id: Ic52e3fa5a7d1d5cb8486e86aa39a845cbd911d94
Signed-off-by: Matus Fabian <[email protected]>
extras/hs-test/infra/hst_suite.go

index 78cabb3..d91958e 100644 (file)
@@ -327,11 +327,11 @@ func (s *HstSuite) AssertNotEqual(expected, actual interface{}, msgAndArgs ...in
 }
 
 func (s *HstSuite) AssertContains(testString, contains interface{}, msgAndArgs ...interface{}) {
-       ExpectWithOffset(2, testString).To(ContainSubstring(fmt.Sprint(contains)), msgAndArgs...)
+       ExpectWithOffset(2, strings.ToLower(fmt.Sprint(testString))).To(ContainSubstring(strings.ToLower(fmt.Sprint(contains))), msgAndArgs...)
 }
 
 func (s *HstSuite) AssertNotContains(testString, contains interface{}, msgAndArgs ...interface{}) {
-       ExpectWithOffset(2, testString).ToNot(ContainSubstring(fmt.Sprint(contains)), msgAndArgs...)
+       ExpectWithOffset(2, strings.ToLower(fmt.Sprint(testString))).ToNot(ContainSubstring(strings.ToLower(fmt.Sprint(contains))), msgAndArgs...)
 }
 
 func (s *HstSuite) AssertEmpty(object interface{}, msgAndArgs ...interface{}) {