diff options
| -rw-r--r-- | src/collection/owned.rs | 10 |
1 files changed, 9 insertions, 1 deletions
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<L: LockableIntoInner> OwnedLockCollection<L> { #[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()); + } } |
