Add test helper functions to reduce Test::new() boilerplate#50
Merged
Add test helper functions to reduce Test::new() boilerplate#50
Conversation
Replace 36 of 37 test call sites with self-documenting helper functions: - default_test(): standard config (27 call sites) - case_insensitive_test(): case-insensitive mode (4 call sites) - no_backspace_test(): backspace disabled (4 call sites) - look_ahead_test(): look-ahead limiting (2 call sites) Helpers are #[cfg(test)] gated and live in test/helpers.rs. One no_backtrack call site remains as Test::new() (single occurrence). Closes #49 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add 5th helper no_backtrack_test() for backtracking-disabled tests - Replace last remaining Test::new() call site in mod.rs - Improve doc-comments with [`default_test`] cross-references - Clarify look_ahead_test docs (uses Some(n) internally) - Add test for no_backtrack_test helper settings Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.
Summary
test/helpers.rsmodule with 4 helper functions:default_test(),case_insensitive_test(),no_backspace_test(),look_ahead_test()Test::new()call sites with self-documenting helpers#[cfg(test)]gated — zero impact on production binaryDesign Decisions
test/helpers.rs): Follows existing pattern oftest/mod.rs+test/results.rsTest plan
test/helpers.rs(verify each helper's settings)#[cfg(test)]gated)Closes #49
🤖 Generated with Claude Code