Remove unused helpers.
Signed-off-by: Daniel Nephin <dnephin@docker.com> Upstream-commit: a0c9089971b6c3cdc9ac1233f3c5e27a0a723214 Component: engine
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user