Use std::assert_matches! in tests (#641)#642
Open
octoaide[bot] wants to merge 3 commits into
Open
Conversation
Replace assert!(matches!(...)) in roxyd tests with std::assert_matches!
and drop redundant {:?} panic messages that duplicate its output.
Co-authored-by: Cursor <cursoragent@cursor.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #642 +/- ##
==========================================
- Coverage 82.02% 81.92% -0.10%
==========================================
Files 27 27
Lines 4261 4261
==========================================
- Hits 3495 3491 -4
- Misses 766 770 +4 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
zmrdltl
requested changes
Jul 1, 2026
zmrdltl
left a comment
Contributor
There was a problem hiding this comment.
Please simplify the path by consolidating std into a single one.
Add a single use std::assert_matches import to test modules in src/bin/roxyd/control.rs and src/bin/roxyd/handlers/hostname.rs. Replace explicit std::assert_matches! calls with assert_matches!. This follows reviewer feedback to consolidate std paths in tests. All 182 tests pass and clippy is clean; the Codecov note is informational for this test-only refactor.
Contributor
Author
|
I reviewed the feedback and made the requested simplifications to the What I changed
Verification
About the Codecov comment
Thanks for the review — the path consolidation request is implemented and verified. |
zmrdltl
approved these changes
Jul 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR converts test-only occurrences of assert!(matches!(...))
to the std::assert_matches! macro where it is safe and clearer.
Summary of changes
same {value:?} output without adding context.
Debug output and do not expose secrets or sensitive payloads.
Why
Using std::assert_matches! improves test diagnostics and intent
compared to assert!(matches!(...)) and makes failure messages
clearer when a match fails.
Verification
Related
Closes #641