Radish alpha
h
Radicle Heartwood Protocol & Stack
Radicle
Git (anonymous pull)
Log in to clone via SSH
radicle-term: Add testcase for Line::spaced()
Matthias Beyer committed 8 months ago
commit 209f33de88e34b2eaaef657b4ff8a289899ff7da
parent 0ebf99a6e32eff60e36841a18fa3ee0757155d04
1 file changed +14 -0
modified crates/radicle-term/src/element.rs
@@ -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"]
+
        );
+
    }
}