forked from hasura/go-graphql-client
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscalar_test.go
More file actions
30 lines (27 loc) · 688 Bytes
/
scalar_test.go
File metadata and controls
30 lines (27 loc) · 688 Bytes
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/hasura/go-graphql-client"
)
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")
}
}