From 1d1cf00b1e8eaff89eba86d4fa6f0dc3e395f2ca Mon Sep 17 00:00:00 2001 From: "Jamil Lambert, PhD" Date: Wed, 26 Mar 2025 09:36:42 +0000 Subject: [PATCH] Add test to BlockTime to kill mutants Mutants found in weekly mutation testing. Add a test to kill them. --- units/src/time.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/units/src/time.rs b/units/src/time.rs index 41faec706..bd0cdb556 100644 --- a/units/src/time.rs +++ b/units/src/time.rs @@ -56,3 +56,14 @@ impl<'a> Arbitrary<'a> for BlockTime { Ok(BlockTime::from(t)) } } + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn block_time_round_trip() { + let t = BlockTime::from(1_742_979_600); // 26 Mar 2025 9:00 UTC + assert_eq!(u32::from(t), 1_742_979_600); + } +}