Skip to content

Commit

Permalink
Merge pull request #539 from 99designs/test-nullable-interface-pointers
Browse files Browse the repository at this point in the history
Test for #484
  • Loading branch information
vektah authored Feb 7, 2019
2 parents f5200c8 + de148d1 commit f81c61d
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions codegen/testserver/interfaces_test.go
Original file line number Diff line number Diff line change
@@ -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())
})
}

0 comments on commit f81c61d

Please sign in to comment.