1
0
mirror of https://github.com/schollz/cowyo.git synced 2023-08-10 21:13:00 +03:00
cowyo/vendor/github.com/shurcooL/graphql/scalar_test.go
2017-10-03 14:43:55 -04:00

31 lines
680 B
Go

package graphql_test
import (
"testing"
"github.com/shurcooL/graphql"
)
func TestNewScalars(t *testing.T) {
if got := graphql.NewBoolean(false); got == nil {
t.Error("NewBoolean returned nil")
}
if got := graphql.NewFloat(0.0); got == nil {
t.Error("NewFloat returned nil")
}
// ID with underlying type string.
if got := graphql.NewID(""); got == nil {
t.Error("NewID returned nil")
}
// ID with underlying type int.
if got := graphql.NewID(0); got == nil {
t.Error("NewID returned nil")
}
if got := graphql.NewInt(0); got == nil {
t.Error("NewInt returned nil")
}
if got := graphql.NewString(""); got == nil {
t.Error("NewString returned nil")
}
}