diff options
Diffstat (limited to 'common/hreflect/helpers_test.go')
-rw-r--r-- | common/hreflect/helpers_test.go | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/common/hreflect/helpers_test.go b/common/hreflect/helpers_test.go index 27b774337..119722261 100644 --- a/common/hreflect/helpers_test.go +++ b/common/hreflect/helpers_test.go @@ -50,6 +50,19 @@ func TestIsContextType(t *testing.T) { c.Assert(IsContextType(reflect.TypeOf(valueCtx)), qt.IsTrue) } +func TestToSliceAny(t *testing.T) { + c := qt.New(t) + + checkOK := func(in any, expected []any) { + out, ok := ToSliceAny(in) + c.Assert(ok, qt.Equals, true) + c.Assert(out, qt.DeepEquals, expected) + } + + checkOK([]any{1, 2, 3}, []any{1, 2, 3}) + checkOK([]int{1, 2, 3}, []any{1, 2, 3}) +} + func BenchmarkIsContextType(b *testing.B) { type k string b.Run("value", func(b *testing.B) { |