MCPcopy
hub / github.com/dgraph-io/dgraph / TestNewSchemaQuery

Function TestNewSchemaQuery

dql/state_test.go:68–96  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

66}
67
68func TestNewSchemaQuery(t *testing.T) {
69 input := `
70 schema {
71 pred
72 type
73 }
74 schema( pred : name ) {
75 pred
76 type
77 }
78 schema( pred : name,hi ) { #This is valid in lexer, parser would throw error
79 pred
80 type
81 }
82 schema( pred : [name,hi] ) {
83 pred
84 type
85 }`
86 l := lex.Lexer{
87 Input: input,
88 }
89 l.Run(lexTopLevel)
90 it := l.NewIterator()
91 for it.Next() {
92 item := it.Item()
93 require.NotEqual(t, item.Typ, lex.ItemError)
94 t.Log(item.String())
95 }
96}
97
98func TestAbruptSchemaQuery(t *testing.T) {
99 input := `

Callers

nothing calls this directly

Calls 6

RunMethod · 0.95
NewIteratorMethod · 0.95
ItemMethod · 0.80
LogMethod · 0.80
NextMethod · 0.45
StringMethod · 0.45

Tested by

no test coverage detected