Add wrap tests for bullet and numbered lists#59
Conversation
Reviewer's GuideThis PR introduces new integration tests to verify that bullet and numbered list items containing inline code wrap correctly within an 80-character limit, and it refactors common assertions into a reusable helper function. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
Warning Rate limit exceeded@leynos has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 1 minutes and 30 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (2)
Summary by CodeRabbit
WalkthroughIntroduce a new public assertion helper function for wrapped list items in the common test module. Refactor an existing integration test to use this helper and add three new tests covering bullet and numbered list items with inline code and multi-digit numbering, all utilising the new assertion helper for validation. Changes
Sequence Diagram(s)sequenceDiagram
participant Test as Integration Test
participant Helper as assert_wrapped_list_item
Test->>Helper: Call with output, prefix, expected lines
Helper->>Helper: Assert output length, prefix, line length, indentation
Helper-->>Test: Return (test passes or fails)
Possibly related PRs
Suggested reviewers
Poem
✨ Finishing Touches
🧪 Generate unit tests
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Hey @leynos - I've reviewed your changes - here's some feedback:
- Consider extracting the shared assertions (line count, prefix checks, max‐width) into a helper so you can reduce duplication between the bullet and numbered list tests.
- It might be worthwhile to add a test case for multi-digit list markers (e.g.
10.) to verify the indentation logic scales correctly.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Consider extracting the shared assertions (line count, prefix checks, max‐width) into a helper so you can reduce duplication between the bullet and numbered list tests.
- It might be worthwhile to add a test case for multi-digit list markers (e.g. `10.`) to verify the indentation logic scales correctly.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
There was a problem hiding this comment.
Actionable comments posted: 2
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (2)
tests/common/mod.rs(1 hunks)tests/integration.rs(1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.rs
Instructions used from:
Sources:
📄 CodeRabbit Inference Engine
- AGENTS.md
⚙️ CodeRabbit Configuration File
🧬 Code Graph Analysis (1)
tests/integration.rs (2)
tests/common/mod.rs (1)
assert_wrapped_list_item(17-25)src/lib.rs (1)
process_stream(580-580)
⏰ Context from checks skipped due to timeout of 240000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: build-test
🔇 Additional comments (1)
tests/integration.rs (1)
667-668: Excellent refactoring using the new helper.The refactoring to use
common::assert_wrapped_list_itemeliminates code duplication and improves maintainability.
|
@sourcery-ai resolve |
|
@sourcery-ai review |
There was a problem hiding this comment.
Hey @leynos - I've reviewed your changes - here's some feedback:
- Add a test case with a three-digit prefix (e.g. '100. ') to ensure the indentation logic handles multi-digit list numbers correctly.
- Include a test where the inline code segment is positioned right at the wrap boundary to verify wrapping doesn’t break code spans across lines.
- Consider extending assert_wrapped_list_item to verify that backtick-enclosed code remains unbroken on a single line, avoiding mid-code splits.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Add a test case with a three-digit prefix (e.g. '100. ') to ensure the indentation logic handles multi-digit list numbers correctly.
- Include a test where the inline code segment is positioned right at the wrap boundary to verify wrapping doesn’t break code spans across lines.
- Consider extending assert_wrapped_list_item to verify that backtick-enclosed code remains unbroken on a single line, avoiding mid-code splits.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Summary
Testing
cargo +nightly-2025-06-10 fmt --allcargo clippy -- -D warningsRUSTFLAGS="-D warnings" cargo testmarkdownlint README.md docs/*.mdnixie docs/*.md README.mdhttps://chatgpt.com/codex/tasks/task_e_687430bae7f08322b6d58a381ed0d28d
Summary by Sourcery
Refactor list wrapping tests to use a shared assertion helper and add parameterized integration tests for bullet and numbered lists containing inline code
Enhancements:
Tests: