diff --git a/components/engine/pkg/testutil/helpers.go b/components/engine/pkg/testutil/helpers.go index c291148712..adc76418e8 100644 --- a/components/engine/pkg/testutil/helpers.go +++ b/components/engine/pkg/testutil/helpers.go @@ -1,9 +1,6 @@ package testutil import ( - "strings" - "unicode" - "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) @@ -14,20 +11,3 @@ func ErrorContains(t require.TestingT, err error, expectedError string) { require.Error(t, err) assert.Contains(t, err.Error(), expectedError) } - -// EqualNormalizedString compare the actual value to the expected value after applying the specified -// transform function. It fails the test if these two transformed string are not equal. -// For example `EqualNormalizedString(t, RemoveSpace, "foo\n", "foo")` wouldn't fail the test as -// spaces (and thus '\n') are removed before comparing the string. -func EqualNormalizedString(t require.TestingT, transformFun func(rune) rune, actual, expected string) { - require.Equal(t, strings.Map(transformFun, expected), strings.Map(transformFun, actual)) -} - -// RemoveSpace returns -1 if the specified runes is considered as a space (unicode) -// and the rune itself otherwise. -func RemoveSpace(r rune) rune { - if unicode.IsSpace(r) { - return -1 - } - return r -}