parseWireMsgs decodes the sequence of length-prefixed backend messages a clientConn wrote to its buffer (type byte + 4-byte length incl. length).
(t *testing.T, buf []byte)
| 60 | " standard ": "standard", // surrounding whitespace ignored |
| 61 | "": "standard", // empty = default |
| 62 | } |
| 63 | for raw, want := range valid { |
| 64 | c := &clientConn{} |
| 65 | if err := c.applyStartupQuerySource(raw); err != nil { |
| 66 | t.Fatalf("applyStartupQuerySource(%q) error: %v", raw, err) |
| 67 | } |
| 68 | if got := c.QuerySource(); got != want { |
| 69 | t.Fatalf("after startup option %q, QuerySource() = %q, want %q", raw, got, want) |
| 70 | } |
| 71 | } |
| 72 | |
| 73 | for _, raw := range []string{"garbage", "endpointss", strings.Repeat("x", 10*1024), "café\n\ttab"} { |
| 74 | c := &clientConn{} |
| 75 | err := c.applyStartupQuerySource(raw) |
| 76 | if err == nil { |
| 77 | t.Fatalf("applyStartupQuerySource(%.40q) = nil error, want 22023 rejection", raw) |
| 78 | } |
no outgoing calls
no test coverage detected