Commit ffb4a46
authored
Add chain-of-messages tests for response parser (#126)
The existing single-message parser tests can pass even if the parser
doesn't fully consume a message (e.g., missing a null terminator),
because there's no subsequent message whose parsing would be corrupted.
These chain tests concatenate multiple messages into a single buffer and
verify the parser correctly advances through each one.
Adds a property-based test with a generator covering all 26 parseable
message types (random sequences of 2-8 messages, verifying each parse
yields non-None and the buffer is fully consumed), plus 7 example-based
tests covering realistic protocol sequences with field-level assertions:
SimpleQueryResult, CopyOutSequence, EmptyQuerySequence, PrepareSequence,
CloseStatementSequence, SASLFullSequence, and RemainingTypes.
Resolves the TODO at the former line 6 of `_test_response_parser.pony`.1 parent b26d3d7 commit ffb4a46
2 files changed
+623
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
123 | 132 | | |
124 | 133 | | |
125 | 134 | | |
| |||
0 commit comments