From ebb97fb7367fb983cffc1935a8fb57e4b80f5249 Mon Sep 17 00:00:00 2001 From: Dave Henderson Date: Thu, 25 Jan 2024 20:11:31 -0500 Subject: Move funcs package to internal (#1977) Signed-off-by: Dave Henderson --- funcs/conv_test.go | 63 ------------------------------------------------------ 1 file changed, 63 deletions(-) delete mode 100644 funcs/conv_test.go (limited to 'funcs/conv_test.go') diff --git a/funcs/conv_test.go b/funcs/conv_test.go deleted file mode 100644 index b20f013c..00000000 --- a/funcs/conv_test.go +++ /dev/null @@ -1,63 +0,0 @@ -package funcs - -import ( - "context" - "fmt" - "strconv" - "testing" - - "github.com/stretchr/testify/assert" -) - -func TestCreateConvFuncs(t *testing.T) { - t.Parallel() - - for i := 0; i < 10; i++ { - // Run this a bunch to catch race conditions - t.Run(strconv.Itoa(i), func(t *testing.T) { - t.Parallel() - - ctx := context.Background() - fmap := CreateConvFuncs(ctx) - actual := fmap["conv"].(func() interface{}) - - assert.Equal(t, ctx, actual().(*ConvFuncs).ctx) - }) - } -} - -func TestDefault(t *testing.T) { - t.Parallel() - - s := struct{}{} - c := &ConvFuncs{} - def := "DEFAULT" - data := []struct { - val interface{} - empty bool - }{ - {0, true}, - {1, false}, - {nil, true}, - {"", true}, - {"foo", false}, - {[]string{}, true}, - {[]string{"foo"}, false}, - {[]string{""}, false}, - {c, false}, - {s, false}, - } - - for _, d := range data { - d := d - t.Run(fmt.Sprintf("%T/%#v empty==%v", d.val, d.val, d.empty), func(t *testing.T) { - t.Parallel() - - if d.empty { - assert.Equal(t, def, c.Default(def, d.val)) - } else { - assert.Equal(t, d.val, c.Default(def, d.val)) - } - }) - } -} -- cgit v1.2.3