diff --git a/src/rstd.rs b/src/rstd.rs index 46aef72..ae84ec0 100644 --- a/src/rstd.rs +++ b/src/rstd.rs @@ -39,6 +39,15 @@ pub(crate) fn hex(point: &Hash) -> impl '_ + Display { Hex { point } } +#[cfg(test)] +#[test] +fn hex_test() { + assert_eq!( + hex(&(0..32).collect::>().try_into().unwrap()).to_string(), + "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", + ); +} + impl Display for Address { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { write!(f, "{}@{}", hex(&self.point), self.index)