radicle-term: Add testcase for Line::spaced()

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
This commit is contained in:
Matthias Beyer 2025-08-21 13:50:09 +02:00 committed by Lorenz Leutgeb
parent 23b9d30639
commit 3036509e42
1 changed files with 14 additions and 0 deletions

View File

@ -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"]
);
}
}