github.com/99designs/gqlgen@v0.17.45/graphql/bool_test.go (about) 1 package graphql 2 3 import ( 4 "bytes" 5 "testing" 6 7 "github.com/stretchr/testify/assert" 8 ) 9 10 func TestBoolean(t *testing.T) { 11 assert.Equal(t, "true", doBooleanMarshal(true)) 12 assert.Equal(t, "false", doBooleanMarshal(false)) 13 } 14 15 func doBooleanMarshal(b bool) string { 16 var buf bytes.Buffer 17 MarshalBoolean(b).MarshalGQL(&buf) 18 return buf.String() 19 }