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/rwlock/read_guard.rs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/rwlock/read_guard.rs') diff --git a/src/rwlock/read_guard.rs b/src/rwlock/read_guard.rs index 8678a8e..2195e44 100644 --- a/src/rwlock/read_guard.rs +++ b/src/rwlock/read_guard.rs @@ -33,12 +33,14 @@ impl Ord for RwLockReadRef<'_, T, R> { } } +#[mutants::skip] // hashing involves PRNG and is hard to test impl Hash for RwLockReadRef<'_, T, R> { fn hash(&self, state: &mut H) { self.deref().hash(state) } } +#[mutants::skip] impl Debug for RwLockReadRef<'_, T, R> { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { Debug::fmt(&**self, f) @@ -85,6 +87,7 @@ impl<'a, T: ?Sized, R: RawRwLock> RwLockReadRef<'a, T, R> { } } +#[mutants::skip] // it's hard to get two read guards safely impl PartialEq for RwLockReadGuard<'_, '_, T, Key, R> { @@ -93,8 +96,10 @@ impl PartialEq } } +#[mutants::skip] // it's hard to get two read guards safely impl Eq for RwLockReadGuard<'_, '_, T, Key, R> {} +#[mutants::skip] // it's hard to get two read guards safely impl PartialOrd for RwLockReadGuard<'_, '_, T, Key, R> { @@ -103,18 +108,21 @@ impl PartialOrd } } +#[mutants::skip] // it's hard to get two read guards safely impl Ord for RwLockReadGuard<'_, '_, T, Key, R> { fn cmp(&self, other: &Self) -> std::cmp::Ordering { self.deref().cmp(&**other) } } +#[mutants::skip] // hashing involves PRNG and is hard to test impl Hash for RwLockReadGuard<'_, '_, T, Key, R> { fn hash(&self, state: &mut H) { self.deref().hash(state) } } +#[mutants::skip] impl Debug for RwLockReadGuard<'_, '_, T, Key, R> { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { Debug::fmt(&**self, f) -- cgit v1.2.3