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 3036509e420846c775a906b514052000cd2e987e
parent 23b9d30639ad7dffc18096b26bea48d4277137d0
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"]
+
        );
+
    }
}