1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
|
package graphql_test
import (
"testing"
"github.com/cli/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")
}
}
|