(t *testing.T)
| 273 | } |
| 274 | |
| 275 | func TestWriteParameterStatus(t *testing.T) { |
| 276 | var buf bytes.Buffer |
| 277 | |
| 278 | err := wire.WriteParameterStatus(&buf, "server_version", "15.0") |
| 279 | if err != nil { |
| 280 | t.Fatalf("wire.WriteParameterStatus() error = %v", err) |
| 281 | } |
| 282 | |
| 283 | // Message type should be 'S' |
| 284 | if buf.Bytes()[0] != 'S' { |
| 285 | t.Errorf("message type = %c, want S", buf.Bytes()[0]) |
| 286 | } |
| 287 | |
| 288 | // Check data contains null-terminated name and value |
| 289 | data := buf.Bytes()[5:] |
| 290 | parts := bytes.Split(data, []byte{0}) |
| 291 | |
| 292 | if string(parts[0]) != "server_version" { |
| 293 | t.Errorf("name = %q, want %q", string(parts[0]), "server_version") |
| 294 | } |
| 295 | if string(parts[1]) != "15.0" { |
| 296 | t.Errorf("value = %q, want %q", string(parts[1]), "15.0") |
| 297 | } |
| 298 | } |
| 299 | |
| 300 | func TestWriteBackendKeyData(t *testing.T) { |
| 301 | var buf bytes.Buffer |
nothing calls this directly
no test coverage detected