File: scalar_test.go

package info (click to toggle)
golang-github-cli-shurcool-graphql 0.0.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 168 kB
  • sloc: makefile: 2
file content (30 lines) | stat: -rw-r--r-- 684 bytes parent folder | download | duplicates (2)
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")
	}
}