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

Function TestFallbackWithComments

tests/integration/fallback_test.go:421–455  ·  view source on GitHub ↗

TestFallbackWithComments tests that DuckDB-specific syntax works when queries have leading comments

(t *testing.T)

Source from the content-addressed store, hash-verified

419// TestFallbackWithComments tests that DuckDB-specific syntax works
420// when queries have leading comments
421func TestFallbackWithComments(t *testing.T) {
422 tests := []QueryTest{
423 // Block comment before DESCRIBE
424 {
425 Name: "block_comment_describe",
426 Query: "/* comment */ DESCRIBE SELECT 1 AS num",
427 DuckgresOnly: true,
428 },
429 // Line comment before FROM-first
430 {
431 Name: "line_comment_from_first",
432 Query: "-- get users\nFROM users SELECT name LIMIT 1",
433 DuckgresOnly: true,
434 },
435 // Multi-line block comment before SUMMARIZE
436 {
437 Name: "multiline_comment_summarize",
438 Query: "/* multi\n line\n comment */ SUMMARIZE SELECT 1, 2, 3",
439 DuckgresOnly: true,
440 },
441 // Multiple comments before utility command
442 {
443 Name: "multiple_comments",
444 Query: "/* first */ -- second\n/* third */ DESCRIBE SELECT 'test'::text",
445 DuckgresOnly: true,
446 },
447 // Block comment before SELECT EXCLUDE
448 {
449 Name: "comment_select_exclude",
450 Query: "/* exclude email */ SELECT * EXCLUDE (email) FROM users LIMIT 1",
451 DuckgresOnly: true,
452 },
453 }
454 runQueryTests(t, tests)
455}
456
457// TestFallbackUtilityWithComments tests utility commands with leading comments
458func TestFallbackUtilityWithComments(t *testing.T) {

Callers

nothing calls this directly

Calls 1

runQueryTestsFunction · 0.85

Tested by

no test coverage detected