From 72845b59ffaad8c837aac2d04fc8c46782505d00 Mon Sep 17 00:00:00 2001 From: timofey Date: Sun, 3 Sep 2023 18:55:47 +0000 Subject: [PATCH] `hex_test` --- src/rstd.rs | 9 +++++++++ 1 file changed, 9 insertions(+) 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)