Skip to content

Commit 55090fa

Browse files
committed
test(search): verify parse_query tokenization with surrounding whitespace and mixed filters
1 parent 64deba4 commit 55090fa

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

‎crates/lore-core/src/search.rs‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -966,4 +966,14 @@ mod tests {
966966
);
967967
assert_eq!(like_escape(""), "");
968968
}
969+
970+
#[test]
971+
fn parse_query_with_surrounding_whitespace_and_mixed_filters() {
972+
let q = parse_query(" search_term agent:claude-code path:src/main.rs model:claude-3-5-sonnet has:error ");
973+
assert_eq!(q.terms, vec!["search_term"]);
974+
assert_eq!(q.agent.as_deref(), Some("claude-code"));
975+
assert_eq!(q.path.as_deref(), Some("src/main.rs"));
976+
assert_eq!(q.model.as_deref(), Some("claude-3-5-sonnet"));
977+
assert!(q.has_error);
978+
}
969979
}

0 commit comments

Comments
 (0)