From 7daf459b1c92389f8a093ee1b513908cca778064 Mon Sep 17 00:00:00 2001 From: Daniel Nephin Date: Mon, 21 Aug 2017 18:26:55 -0400 Subject: [PATCH] Remove unused helpers. Signed-off-by: Daniel Nephin Upstream-commit: a0c9089971b6c3cdc9ac1233f3c5e27a0a723214 Component: engine --- components/engine/pkg/testutil/helpers.go | 20 -------------------- 1 file changed, 20 deletions(-) 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 -}