MCPcopy Create free account
hub / github.com/PostHog/duckgres / TestEmptyQuery

Function TestEmptyQuery

tests/integration/protocol_test.go:46–66  ·  view source on GitHub ↗

TestEmptyQuery tests that empty queries return EmptyQueryResponse, not an error.

(t *testing.T)

Source from the content-addressed store, hash-verified

44
45// TestEmptyQuery tests that empty queries return EmptyQueryResponse, not an error.
46func TestEmptyQuery(t *testing.T) {
47 tests := []struct {
48 name string
49 query string
50 }{
51 {"semicolon", ";"},
52 {"semicolon_newline", ";\n"},
53 {"multiple_semicolons", ";;;"},
54 {"whitespace_semicolons", " ; ; "},
55 {"empty_string", ""},
56 }
57
58 for _, tt := range tests {
59 t.Run(tt.name, func(t *testing.T) {
60 _, err := testHarness.DuckgresDB.Exec(tt.query)
61 if err != nil {
62 t.Errorf("Empty query %q should not return an error, got: %v", tt.query, err)
63 }
64 })
65 }
66}
67
68// TestProtocolSimpleQuery tests the simple query protocol
69func TestProtocolSimpleQuery(t *testing.T) {

Callers

nothing calls this directly

Calls 2

RunMethod · 0.65
ExecMethod · 0.65

Tested by

no test coverage detected