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

Function TestOperatorTransform_ArrayExpr

transpiler/transform/wiring_ops_test.go:88–97  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

86}
87
88func TestOperatorTransform_ArrayExpr(t *testing.T) {
89 tr := NewOperatorTransform()
90 // Semantic regression: untransformed, the raw `~` binds to DuckDB's
91 // regexp_full_match and ARRAY['abc' ~ 'b'] evaluates to [false] instead
92 // of [true]. The rewrite to regexp_matches preserves Postgres semantics.
93 out := deparseAfter(t, tr, `SELECT ARRAY['abc' ~ 'b']`)
94 if !strings.Contains(out, "regexp_matches('abc', 'b')") {
95 t.Errorf("expected regexp_matches inside ARRAY[...], got %q", out)
96 }
97}
98
99func TestOperatorTransform_DistinctOn(t *testing.T) {
100 tr := NewOperatorTransform()

Callers

nothing calls this directly

Calls 2

NewOperatorTransformFunction · 0.85
deparseAfterFunction · 0.85

Tested by

no test coverage detected