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

Function TestQueryLexing

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

Source from the content-addressed store, hash-verified

14)
15
16func TestQueryLexing(t *testing.T) {
17 input := `
18 query {
19 me(_xid_: rick, id:10 ) {
20 name0 # my name
21 _city, # 0what would fail lex.
22 profilePic(width: 100, height: 100)
23 friends {
24 name
25 }
26 }
27 }`
28 l := &lex.Lexer{}
29 l.Reset(input)
30 l.Run(lexQuery)
31
32 it := l.NewIterator()
33 for it.Next() {
34 item := it.Item()
35 require.NotEqual(t, item.Typ, lex.ItemError)
36 t.Log(item.String())
37 }
38}
39
40func TestMutationLexing(t *testing.T) {
41 input := `

Callers

nothing calls this directly

Calls 7

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

Tested by

no test coverage detected