Skip to content

Commit

Permalink
Test style_suggestion
Browse files Browse the repository at this point in the history
  • Loading branch information
ysthakur committed Jun 9, 2024
1 parent 9c1cc40 commit f66f07c
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/menu/menu_functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -731,4 +731,15 @@ mod tests {
assert_eq!(orig_buffer, editor.get_buffer());
assert_eq!(orig_insertion_point, editor.insertion_point());
}

#[test]
fn style_fuzzy_suggestion() {
let match_style = Style::new().italic();
let text_style = Style::new().dimmed();

assert_eq!(
"\u{1b}[2m\u{1b}[0m\u{1b}[3mab\u{1b}[0m\u{1b}[2mcd\u{1b}[0m\u{1b}[3me\u{1b}[0m\u{1b}[2mfg\u{1b}[0m",
style_suggestion("abcdefg", &[0, 1, 4], &match_style, &text_style)
);
}
}

0 comments on commit f66f07c

Please sign in to comment.