diff --git a/tests/data/regression_table_expected.txt b/tests/data/regression_table_expected.txt new file mode 100644 index 00000000..e639ce0c --- /dev/null +++ b/tests/data/regression_table_expected.txt @@ -0,0 +1,8 @@ +| # | Task | Description | Size | Depends On | +| --- | ------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------ | ---------- | +| 3.1 | Graceful Shutdown | Implement the server-wide graceful shutdown pattern. Use tokio_util::sync::CancellationToken for signalling and tokio_util::task::TaskTracker to ensure all connection actors terminate cleanly. | Large | #1.3 | +| 3.2 | Re-assembly DoS Protection | Harden the FragmentAdapter by adding a non-optional, configurable timeout for partial message re-assembly and strictly enforcing the max_message_size limit to prevent memory exhaustion. | Medium | #1.5 | +| 3.3 | Multiplexed Re-assembly | Enhance the FragmentAdapter's inbound logic to support concurrent re-assembly of multiple messages. Use the msg_id from FragmentMeta as a key into a dashmap::DashMap of partial messages. | Large | #3.2 | +| 3.4 | Per-Connection Rate Limiting | Integrate an asynchronous, token-bucket rate limiter into the PushHandle. The rate limit should be configurable on the WireframeApp builder and enforced on every push. | Medium | #2.2 | +| 3.5 | Dead Letter Queue (DLQ) | Implement the optional Dead Letter Queue mechanism. Allow a user to provide a DLQ channel sender during app setup; failed pushes (due to a full queue) can be routed there instead of being dropped. | Medium | #2.2 | +| 3.6 | Context-Aware FragmentStrategy | Enhance the FragmentStrategy trait. max_fragment_payload and encode_header should receive a reference to the logical Frame being processed, allowing for more dynamic fragmentation rules. | Small | #1.4 | diff --git a/tests/data/regression_table_input.txt b/tests/data/regression_table_input.txt new file mode 100644 index 00000000..e639ce0c --- /dev/null +++ b/tests/data/regression_table_input.txt @@ -0,0 +1,8 @@ +| # | Task | Description | Size | Depends On | +| --- | ------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------ | ---------- | +| 3.1 | Graceful Shutdown | Implement the server-wide graceful shutdown pattern. Use tokio_util::sync::CancellationToken for signalling and tokio_util::task::TaskTracker to ensure all connection actors terminate cleanly. | Large | #1.3 | +| 3.2 | Re-assembly DoS Protection | Harden the FragmentAdapter by adding a non-optional, configurable timeout for partial message re-assembly and strictly enforcing the max_message_size limit to prevent memory exhaustion. | Medium | #1.5 | +| 3.3 | Multiplexed Re-assembly | Enhance the FragmentAdapter's inbound logic to support concurrent re-assembly of multiple messages. Use the msg_id from FragmentMeta as a key into a dashmap::DashMap of partial messages. | Large | #3.2 | +| 3.4 | Per-Connection Rate Limiting | Integrate an asynchronous, token-bucket rate limiter into the PushHandle. The rate limit should be configurable on the WireframeApp builder and enforced on every push. | Medium | #2.2 | +| 3.5 | Dead Letter Queue (DLQ) | Implement the optional Dead Letter Queue mechanism. Allow a user to provide a DLQ channel sender during app setup; failed pushes (due to a full queue) can be routed there instead of being dropped. | Medium | #2.2 | +| 3.6 | Context-Aware FragmentStrategy | Enhance the FragmentStrategy trait. max_fragment_payload and encode_header should receive a reference to the logical Frame being processed, allowing for more dynamic fragmentation rules. | Small | #1.4 | diff --git a/tests/integration.rs b/tests/integration.rs index 08e0d4e5..959685b8 100644 --- a/tests/integration.rs +++ b/tests/integration.rs @@ -646,3 +646,21 @@ fn test_preserve_hard_line_breaks() { assert_eq!(output[0], "Line one with break."); assert_eq!(output[1], "Line two follows."); } + +#[test] +/// Tests that `process_stream` preserves complex table formatting without modification. +/// +/// This regression test ensures that properly formatted complex tables with multiple +/// columns and detailed content pass through the processing pipeline unchanged, +/// preventing regressions that might inadvertently alter correct formatting. +fn test_regression_complex_table() { + let input: Vec = include_str!("data/regression_table_input.txt") + .lines() + .map(str::to_string) + .collect(); + let expected: Vec = include_str!("data/regression_table_expected.txt") + .lines() + .map(str::to_string) + .collect(); + assert_eq!(process_stream(&input), expected); +}