From 280a61ad7b74019c7aad8b7306a0dd7cfb11359c Mon Sep 17 00:00:00 2001 From: Botahamec Date: Sun, 12 Jan 2025 15:04:01 -0500 Subject: More unit tests --- src/poisonable/guard.rs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/poisonable/guard.rs') diff --git a/src/poisonable/guard.rs b/src/poisonable/guard.rs index 97d1c60..36566f5 100644 --- a/src/poisonable/guard.rs +++ b/src/poisonable/guard.rs @@ -48,12 +48,14 @@ impl Ord for PoisonRef<'_, Guard> { } } +#[mutants::skip] // hashing involves RNG and is hard to test impl Hash for PoisonRef<'_, Guard> { fn hash(&self, state: &mut H) { self.guard.hash(state) } } +#[mutants::skip] impl Debug for PoisonRef<'_, Guard> { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { Debug::fmt(&**self, f) @@ -92,32 +94,38 @@ impl AsMut for PoisonRef<'_, Guard> { } } +#[mutants::skip] // it's hard to get two guards safely impl PartialEq for PoisonGuard<'_, '_, Guard, Key> { fn eq(&self, other: &Self) -> bool { self.guard.eq(&other.guard) } } +#[mutants::skip] // it's hard to get two guards safely impl PartialOrd for PoisonGuard<'_, '_, Guard, Key> { fn partial_cmp(&self, other: &Self) -> Option { self.guard.partial_cmp(&other.guard) } } +#[mutants::skip] // it's hard to get two guards safely impl Eq for PoisonGuard<'_, '_, Guard, Key> {} +#[mutants::skip] // it's hard to get two guards safely impl Ord for PoisonGuard<'_, '_, Guard, Key> { fn cmp(&self, other: &Self) -> std::cmp::Ordering { self.guard.cmp(&other.guard) } } +#[mutants::skip] // hashing involves RNG and is hard to test impl Hash for PoisonGuard<'_, '_, Guard, Key> { fn hash(&self, state: &mut H) { self.guard.hash(state) } } +#[mutants::skip] impl Debug for PoisonGuard<'_, '_, Guard, Key> { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { Debug::fmt(&self.guard, f) -- cgit v1.2.3