node: Improve some tests

Signed-off-by: Alexis Sellier <self@cloudhead.io>
This commit is contained in:
Alexis Sellier
2022-09-13 10:16:05 +02:00
parent cd7421eb86
commit a4d2232578
3 changed files with 34 additions and 6 deletions
+16
View File
@@ -315,4 +315,20 @@ pub mod canonical {
}
}
#[cfg(test)]
mod tests {
use super::*;
use quickcheck_macros::quickcheck;
#[quickcheck]
fn prop_canonical_roundtrip(refs: Refs) {
let encoded = refs.canonical();
let decoded = Refs::from_canonical(&encoded).unwrap();
println!("{:?}", refs);
assert_eq!(refs, decoded);
}
}
// TODO: Test canonical/from_canonical