diff options
Diffstat (limited to 'src/collection/owned.rs')
| -rw-r--r-- | src/collection/owned.rs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/collection/owned.rs b/src/collection/owned.rs index f2b6cc9..9aa7460 100644 --- a/src/collection/owned.rs +++ b/src/collection/owned.rs @@ -393,3 +393,20 @@ impl<L: Sharable> OwnedLockCollection<L> { guard.key } } + +#[cfg(test)] +mod tests { + use super::*; + use crate::Mutex; + + #[test] + fn can_be_extended() { + let mutex1 = Mutex::new(0); + let mutex2 = Mutex::new(1); + let mut collection = OwnedLockCollection::new(vec![mutex1, mutex2]); + + collection.extend([Mutex::new(2)]); + + assert_eq!(collection.data.len(), 3); + } +} |
