fix clippy and unittest

This commit is contained in:
Stephan Dilly 2020-12-19 21:45:09 +01:00
parent 3ff77e0669
commit 779b2d572f

View file

@ -170,7 +170,7 @@ impl TextInputComponent {
txt = text_append( txt = text_append(
txt, txt,
Text::styled( Text::styled(
substitute.clone(), substitute.to_owned(),
self.theme self.theme
.text(false, false) .text(false, false)
.add_modifier(Modifier::UNDERLINED), .add_modifier(Modifier::UNDERLINED),
@ -413,8 +413,8 @@ mod tests {
"", "",
); );
let theme = SharedTheme::default(); let theme = SharedTheme::default();
let underlined = theme let underlined_whitespace = theme
.text(true, false) .text(false, false)
.add_modifier(Modifier::UNDERLINED); .add_modifier(Modifier::UNDERLINED);
let not_underlined = Style::default(); let not_underlined = Style::default();
@ -430,8 +430,11 @@ mod tests {
get_style(&txt.lines[0].0[0]), get_style(&txt.lines[0].0[0]),
Some(&not_underlined) Some(&not_underlined)
); );
assert_eq!(get_text(&txt.lines[0].0[1]), Some(" ")); assert_eq!(get_text(&txt.lines[0].0[1]), Some("\u{00B7}"));
assert_eq!(get_style(&txt.lines[0].0[1]), Some(&underlined)); assert_eq!(
get_style(&txt.lines[0].0[1]),
Some(&underlined_whitespace)
);
} }
#[test] #[test]