Lines
100 %
Functions
Branches
use ratatui::style::{Color, Style};
use super::*;
#[test]
fn the_hotkey_is_the_marked_letter() {
assert_eq!(hotkey("Co~n~sole"), Some('n'));
assert_eq!(hotkey("Console"), None);
assert_eq!(hotkey("Con~sole"), None);
}
fn marks_are_stripped_and_split_the_spans() {
assert_eq!(plain("Co~n~sole"), "Console");
let (base, hot) = (Style::new(), Style::new().fg(Color::Red));
let parts = spans("Co~n~sole", base, hot);
let text: Vec<_> = parts.iter().map(|s| s.content.to_string()).collect();
assert_eq!(text, ["Co", "n", "sole"]);
assert_eq!(parts[1].style, hot);
assert_eq!(parts[0].style, base);