Radish alpha
r
rad:z6cFWeWpnZNHh9rUW8phgA3b5yGt
Git libraries for Radicle
Radicle
Git
test: add roundtrip::json_value
Fintan Halpenny committed 3 years ago
commit 9d137e5e7dee36ac1f4782bf431499ed0c581a7e
parent 1316a13
1 file changed +10 -0
modified test/test-helpers/src/roundtrip.rs
@@ -20,6 +20,16 @@ where
    )
}

+
pub fn json_value<A>(a: A)
+
where
+
    for<'de> A: Clone + Debug + PartialEq + serde::Serialize + serde::Deserialize<'de>,
+
{
+
    assert_eq!(
+
        a.clone(),
+
        serde_json::from_value(serde_json::to_value(a).unwrap()).unwrap()
+
    )
+
}
+

pub fn cbor<A>(a: A)
where
    for<'de> A: Debug + PartialEq + minicbor::Encode + minicbor::Decode<'de>,