Skip to content

test(classify): unit tests + proptest for routing classifier#322

Merged
Destynova2 merged 1 commit intomainfrom
test/classify-unit-tests
Apr 28, 2026
Merged

test(classify): unit tests + proptest for routing classifier#322
Destynova2 merged 1 commit intomainfrom
test/classify-unit-tests

Conversation

@Destynova2
Copy link
Copy Markdown
Contributor

Summary

  • 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 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 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, validating idempotence on the lowercase-only model-ID subspace and panic-freedom on arbitrary Unicode input.
  • Test-only change; no production code touched.

Branch was created from fix/preset-mod-include-str per the task brief, but that branch has already been merged (PR #304) and removed from the remote, so this PR targets main directly.

Test plan

  • cargo nextest run --lib routing::classify - 131 passed (up from 108)
  • cargo nextest run --lib - 1075 passed
  • cargo fmt --check
  • cargo clippy --tests --lib --no-deps -- -D warnings
  • cargo test --doc routing::classify::model_name - 2 passed

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>
@Destynova2 Destynova2 enabled auto-merge April 28, 2026 20:45
@Destynova2 Destynova2 merged commit 2a5f744 into main Apr 28, 2026
42 checks passed
@Destynova2 Destynova2 deleted the test/classify-unit-tests branch April 28, 2026 21:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant