From f73ecb2b667c145232ffd09f3f221b1ac3ac5aa9 Mon Sep 17 00:00:00 2001 From: Adam Scarr Date: Thu, 7 Feb 2019 21:11:28 +1100 Subject: [PATCH] Test for #484 --- codegen/testserver/interfaces_test.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 codegen/testserver/interfaces_test.go diff --git a/codegen/testserver/interfaces_test.go b/codegen/testserver/interfaces_test.go new file mode 100644 index 0000000000..d10f48b071 --- /dev/null +++ b/codegen/testserver/interfaces_test.go @@ -0,0 +1,16 @@ +package testserver + +import ( + "reflect" + "testing" + + "github.com/stretchr/testify/require" +) + +func TestInterfaces(t *testing.T) { + t.Run("slices of interfaces are not pointers", func(t *testing.T) { + field, ok := reflect.TypeOf((*QueryResolver)(nil)).Elem().MethodByName("Shapes") + require.True(t, ok) + require.Equal(t, "[]testserver.Shape", field.Type.Out(0).String()) + }) +}