Skip to content

Add chain-of-messages tests for response parser#126

Merged
SeanTAllen merged 1 commit intomainfrom
chain-of-messages-tests
Feb 14, 2026
Merged

Add chain-of-messages tests for response parser#126
SeanTAllen merged 1 commit intomainfrom
chain-of-messages-tests

Conversation

@SeanTAllen
Copy link
Copy Markdown
Member

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.

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.
@ponylang-main ponylang-main added the discuss during sync Should be discussed during an upcoming sync label Feb 14, 2026
@SeanTAllen SeanTAllen merged commit ffb4a46 into main Feb 14, 2026
10 checks passed
@SeanTAllen SeanTAllen deleted the chain-of-messages-tests branch February 14, 2026 19:00
@ponylang-main ponylang-main removed the discuss during sync Should be discussed during an upcoming sync label Feb 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants