testQuery checks both that the parse is successful and that the two resulting ASTs from the round trip through json marshal and unmarshal are equivalent.
(t *testing.T, line string)
| 58 | // two resulting ASTs from the round trip through json marshal and |
| 59 | // unmarshal are equivalent. |
| 60 | func testQuery(t *testing.T, line string) { |
| 61 | pigeonJSON, err := parsePigeon(line) |
| 62 | assert.NoError(t, err, "parsePigeon: %q", line) |
| 63 | |
| 64 | astJSON, err := parseOp(line) |
| 65 | assert.NoError(t, err, "parseOp: %q", line) |
| 66 | |
| 67 | assert.JSONEq(t, string(pigeonJSON), string(astJSON), "pigeon and AST mismatch: %q", line) |
| 68 | } |
| 69 | |
| 70 | func TestValid(t *testing.T) { |
| 71 | file, err := fs.Open("valid.spq") |
no test coverage detected