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

Function TestMutationLexing

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

Source from the content-addressed store, hash-verified

38}
39
40func TestMutationLexing(t *testing.T) {
41 input := `
42 mutation {
43 set {
44 What is <this> .
45 Why is this #!!?
46 How is this?
47 }
48 delete {
49 Why is this
50 }
51 }
52 query {
53 me(_xid_: rick) {
54 _city
55 }
56 }`
57 l := &lex.Lexer{}
58 l.Reset(input)
59 l.Run(lexTopLevel)
60 it := l.NewIterator()
61 for it.Next() {
62 item := it.Item()
63 require.NotEqual(t, item.Typ, lex.ItemError, "Error: %v", item.String())
64 t.Log(item.String())
65 }
66}
67
68func TestNewSchemaQuery(t *testing.T) {
69 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