test(classify): unit tests + proptest for routing classifier#322
Merged
Destynova2 merged 1 commit intomainfrom Apr 28, 2026
Merged
test(classify): unit tests + proptest for routing classifier#322Destynova2 merged 1 commit intomainfrom
Destynova2 merged 1 commit intomainfrom
Conversation
Adds 20 unit tests in `src/routing/classify/tests.rs` covering background regex case-sensitivity, prompt-rule precedence and skip behaviour, canonicalization integration with `[[models]]` lookup, auto-map edge cases (PR #293 alias coverage), malformed config tolerance, full priority chain pins (websearch > background > auto-map > prompt-rules > think), and `[[tiers.match]]` wiring through the public `Router::route` surface. Adds 1 unit test (`canonicalize_preserves_known_canonical_forms`) and 2 proptests (`prop_canonicalize_is_idempotent_lower_only`, `prop_canonicalize_does_not_panic`) in `src/routing/classify/model_name.rs` so canonicalization idempotence is verified across both the lowercase-only subspace requested by the test plan and arbitrary Unicode input. All 131 routing::classify tests pass; full lib suite (1075 tests) green. Co-Authored-By: Claude Opus 4.7 (1M context) <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
src/routing/classify/tests.rscovering background-regex case-sensitivity, prompt-rule precedence and skip behaviour, canonicalization integration with[[models]]lookup, auto-map edge cases (PR fix(routing): auto-map respects explicit [[models]] entries #293 alias coverage), malformed-config tolerance, full priority-chain pins (websearch > background > auto-map > prompt-rules > think), and[[tiers.match]]wiring through the publicRouter::routesurface.canonicalize_preserves_known_canonical_forms) and 2 proptests (prop_canonicalize_is_idempotent_lower_only,prop_canonicalize_does_not_panic) insrc/routing/classify/model_name.rs, validating idempotence on the lowercase-only model-ID subspace and panic-freedom on arbitrary Unicode input.Branch was created from
fix/preset-mod-include-strper the task brief, but that branch has already been merged (PR #304) and removed from the remote, so this PR targetsmaindirectly.Test plan
cargo nextest run --lib routing::classify- 131 passed (up from 108)cargo nextest run --lib- 1075 passedcargo fmt --checkcargo clippy --tests --lib --no-deps -- -D warningscargo test --doc routing::classify::model_name- 2 passed