-
Notifications
You must be signed in to change notification settings - Fork 5
Missing test for get_regex_accelerator negative path #257
Copy link
Copy link
Open
Labels
Description
Summary
get_regex_accelerator in accelerators.rs:57-64 has no direct test for the negative path (unknown pattern returning None).
Details
The function is the core dispatch mechanism for the inventory-based accelerator hook system (PR #249). The positive path (matching a registered pattern) is tested indirectly through oracle tests. But the negative path (unknown pattern) has no test.
If get_regex_accelerator were accidentally changed to panic instead of returning None on unknown patterns, no test would catch that directly.
Suggested fix
#[test]
fn test_unknown_pattern_returns_none() {
let unknown = ConstRegexPattern::Basic("not_a_real_pattern");
assert!(get_regex_accelerator(&unknown).is_none());
}Files
crates/wordchipper/src/spanners/span_lexers/accelerators.rs:57-64
Reactions are currently unavailable