From 3a299432173f98521d0aeb840dafb6710ce27f82 Mon Sep 17 00:00:00 2001 From: Botahamec Date: Sun, 16 Mar 2025 19:34:17 -0400 Subject: Add test for owned lock in lock collection --- src/collection/owned.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/collection/owned.rs b/src/collection/owned.rs index 866d778..38e6a16 100644 --- a/src/collection/owned.rs +++ b/src/collection/owned.rs @@ -503,7 +503,7 @@ impl OwnedLockCollection { #[cfg(test)] mod tests { use super::*; - use crate::{Mutex, RwLock, ThreadKey}; + use crate::{LockCollection, Mutex, RwLock, ThreadKey}; #[test] fn get_mut_applies_changes() { @@ -778,4 +778,12 @@ mod tests { 42 ); } + + #[test] + fn duplicates_detected() { + let collection1 = OwnedLockCollection::new([Mutex::new(5), Mutex::new(10)]); + let collection2 = LockCollection::try_new((&collection1, &collection1)); + + assert!(collection2.is_none()); + } } -- cgit v1.2.3