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

Function TestHandleBindValidMessageStillBinds

server/conn_bind_test.go:145–161  ·  view source on GitHub ↗

Sanity-check the happy path still binds: one NULL param (length -1), default format codes everywhere.

(t *testing.T)

Source from the content-addressed store, hash-verified

143// Sanity-check the happy path still binds: one NULL param (length -1),
144// default format codes everywhere.
145func TestHandleBindValidMessageStillBinds(t *testing.T) {
146 var out bytes.Buffer
147 c := newBindTestConn(&out)
148
149 c.handleBind(bindMessageBody("p1", "s1", int16(0), int16(1), int32(-1), int16(0)))
150
151 if bytes.Contains(out.Bytes(), []byte("08P01")) {
152 t.Fatalf("unexpected protocol error for valid Bind message: %q", out.Bytes())
153 }
154 p, ok := c.portals["p1"]
155 if !ok {
156 t.Fatal("expected portal to be created")
157 }
158 if len(p.paramValues) != 1 || p.paramValues[0] != nil {
159 t.Fatalf("expected one NULL param value, got %v", p.paramValues)
160 }
161}

Callers

nothing calls this directly

Calls 3

newBindTestConnFunction · 0.85
bindMessageBodyFunction · 0.85
handleBindMethod · 0.80

Tested by

no test coverage detected