This commit is contained in:
Alexandre Bury 2020-08-26 13:56:24 -07:00
parent eec4dd8e68
commit f13914a272

View File

@ -16,6 +16,26 @@ fn input() -> StyledString {
text
}
#[test]
fn test_next_line_char() {
let d: Vec<u8> = vec![194, 133, 45, 127, 29, 127, 127];
let text = std::str::from_utf8(&d).unwrap();
let string = StyledString::plain(text);
let iter = LinesIterator::new(&string, 20);
let rows: Vec<_> = iter.map(|row| row.resolve(&string)).collect();
assert_eq!(
&rows[..],
&[
vec![],
vec![Span {
content: "-\u{7f}\u{1d}\u{7f}\u{7f}",
attr: &Style::none(),
width: 1,
}],
],
);
}
#[test]
fn test_line_breaks() {
let input = input();