radicle-term: Add testcase for Line::spaced()
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
This commit is contained in:
parent
23b9d30639
commit
3036509e42
|
|
@ -394,4 +394,18 @@ mod test {
|
||||||
let line = Line::new("❤️");
|
let line = Line::new("❤️");
|
||||||
assert_eq!(line.width(), 2, "{line}");
|
assert_eq!(line.width(), 2, "{line}");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_spaced() {
|
||||||
|
let line = Line::spaced(["banana", "peach", "apple"].into_iter().map(Label::new));
|
||||||
|
|
||||||
|
let iterated: Vec<_> = line.into_iter().collect();
|
||||||
|
assert_eq!(
|
||||||
|
iterated
|
||||||
|
.into_iter()
|
||||||
|
.map(|l| l.to_string())
|
||||||
|
.collect::<Vec<_>>(),
|
||||||
|
["banana", " ", "peach", " ", "apple"]
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue