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/mutex/guard.rs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/mutex/guard.rs') diff --git a/src/mutex/guard.rs b/src/mutex/guard.rs index 0d35cf4..f7a01a4 100644 --- a/src/mutex/guard.rs +++ b/src/mutex/guard.rs @@ -33,12 +33,14 @@ impl Ord for MutexRef<'_, T, R> { } } +#[mutants::skip] // hashing involves RNG and is hard to test impl Hash for MutexRef<'_, T, R> { fn hash(&self, state: &mut H) { self.deref().hash(state) } } +#[mutants::skip] impl Debug for MutexRef<'_, T, R> { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { Debug::fmt(&**self, f) @@ -103,14 +105,17 @@ impl<'a, T: ?Sized, R: RawMutex> MutexRef<'a, T, R> { // it's kinda annoying to re-implement some of this stuff on guards // there's nothing i can do about that +#[mutants::skip] // it's hard to get two guards safely impl PartialEq for MutexGuard<'_, '_, T, Key, R> { fn eq(&self, other: &Self) -> bool { self.deref().eq(&**other) } } +#[mutants::skip] // it's hard to get two guards safely impl Eq for MutexGuard<'_, '_, T, Key, R> {} +#[mutants::skip] // it's hard to get two guards safely impl PartialOrd for MutexGuard<'_, '_, T, Key, R> { @@ -119,18 +124,21 @@ impl PartialOrd } } +#[mutants::skip] // it's hard to get two guards safely impl Ord for MutexGuard<'_, '_, T, Key, R> { fn cmp(&self, other: &Self) -> std::cmp::Ordering { self.deref().cmp(&**other) } } +#[mutants::skip] // hashing involves RNG and is hard to test impl Hash for MutexGuard<'_, '_, T, Key, R> { fn hash(&self, state: &mut H) { self.deref().hash(state) } } +#[mutants::skip] impl Debug for MutexGuard<'_, '_, T, Key, R> { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { Debug::fmt(&**self, f) -- cgit v1.2.3