Radish alpha
h
Radicle Heartwood Protocol & Stack
Radicle
Git (anonymous pull)
Log in to clone via SSH
REVIEW: Add unit tests for optionally prefixed RID
Erik Kundt committed 7 months ago
commit a160b1d3901072e8225ec270290356f680c5254c
parent 716f091c9fd4728303bd1272b6d856dd5316110b
1 file changed +24 -0
modified crates/radicle-cli/src/commands/clone/args.rs
@@ -97,3 +97,27 @@ pub struct Args {
    #[arg(long, hide = true)]
    pub(super) no_confirm: bool,
}
+

+
#[cfg(test)]
+
mod test {
+
    use super::Args;
+
    use clap::Parser;
+

+
    #[test]
+
    fn should_parse_rid_non_urn() {
+
        let args = Args::try_parse_from(["clone", "z3Tr6bC7ctEg2EHmLvknUr29mEDLH"]);
+
        assert!(args.is_ok())
+
    }
+

+
    #[test]
+
    fn should_parse_rid_urn() {
+
        let args = Args::try_parse_from(["clone", "rad:z3Tr6bC7ctEg2EHmLvknUr29mEDLH"]);
+
        assert!(args.is_ok())
+
    }
+

+
    #[test]
+
    fn should_parse_rid_url() {
+
        let args = Args::try_parse_from(["clone", "rad://z3Tr6bC7ctEg2EHmLvknUr29mEDLH"]);
+
        assert!(args.is_ok())
+
    }
+
}