mirror of
https://github.com/FliegendeWurst/cursive.git
synced 2024-11-23 17:35:00 +00:00
Add test
This commit is contained in:
parent
eec4dd8e68
commit
f13914a272
@ -16,6 +16,26 @@ fn input() -> StyledString {
|
|||||||
text
|
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]
|
#[test]
|
||||||
fn test_line_breaks() {
|
fn test_line_breaks() {
|
||||||
let input = input();
|
let input = input();
|
||||||
|
Loading…
Reference in New Issue
Block a user