mirror of
https://seed.radicle.dev/rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5.git
synced 2026-11-16 08:10:40 +08:00
radicle-term: Add testcase for Line::spaced()
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
This commit is contained in:
committed by
Lorenz Leutgeb
parent
23b9d30639
commit
3036509e42
@@ -394,4 +394,18 @@ mod test {
|
||||
let line = Line::new("❤️");
|
||||
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"]
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user