This commit is contained in:
easong-openai
2025-08-04 10:23:50 -07:00
parent 16e1a5b45b
commit e112464f99
2 changed files with 12 additions and 4 deletions
+8 -2
View File
@@ -90,14 +90,20 @@ mod tests {
#[test]
fn ascii_basic_indices() {
let (idx, _score) = fuzzy_match("hello", "hl").expect("match");
let (idx, _score) = match fuzzy_match("hello", "hl") {
Some(v) => v,
None => panic!("expected a match"),
};
assert_eq!(idx, vec![0, 2]);
}
#[test]
fn unicode_dotted_i_istanbul_highlighting() {
// 'İ' lowercases to two chars (i + combining dot). Ensure index 0 is highlighted once.
let (idx, _score) = fuzzy_match("İstanbul", "is").expect("match");
let (idx, _score) = match fuzzy_match("İstanbul", "is") {
Some(v) => v,
None => panic!("expected a match"),
};
assert_eq!(idx, vec![0, 1]);
}
@@ -451,7 +451,7 @@ impl ChatComposer<'_> {
/// Handle key events when file search popup is visible.
fn handle_key_event_with_file_popup(&mut self, key_event: KeyEvent) -> (InputResult, bool) {
let first_line_owned = self.first_line().to_string();
let _first_line_owned = self.first_line().to_string();
let ActivePopup::File(popup) = &mut self.active_popup else {
unreachable!();
};
@@ -1222,7 +1222,9 @@ mod tests {
let mut terminal = match Terminal::new(TestBackend::new(100, 10)) {
Ok(t) => t,
Err(e) => {
eprintln!("Skipping ui_snapshots: failed to create terminal: {e}");
// Avoid printing directly to stderr/stdout (clippy::print_stderr).
// Log a warning instead and skip the snapshot test.
tracing::warn!("Skipping ui_snapshots: failed to create terminal: {e}");
return;
}
};