Sanity-check the happy path still binds: one NULL param (length -1), default format codes everywhere.
(t *testing.T)
| 143 | // Sanity-check the happy path still binds: one NULL param (length -1), |
| 144 | // default format codes everywhere. |
| 145 | func 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 | } |
nothing calls this directly
no test coverage detected