MCPcopy Create free account
hub / github.com/brimdata/super / testQuery

Function testQuery

compiler/parser/parser_test.go:60–68  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

58// two resulting ASTs from the round trip through json marshal and
59// unmarshal are equivalent.
60func 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
70func TestValid(t *testing.T) {
71 file, err := fs.Open("valid.spq")

Callers 2

TestValidFunction · 0.85
TestZtestSuperSQLFunction · 0.85

Calls 2

parsePigeonFunction · 0.85
parseOpFunction · 0.85

Tested by

no test coverage detected