(t *testing.T)
| 14 | ) |
| 15 | |
| 16 | func 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 | |
| 40 | func TestMutationLexing(t *testing.T) { |
| 41 | input := ` |