summaryrefslogtreecommitdiff
path: root/src/collection/owned.rs
diff options
context:
space:
mode:
authorMica White <botahamec@gmail.com>2024-12-01 15:28:44 -0500
committerMica White <botahamec@gmail.com>2024-12-01 15:29:19 -0500
commit48aaedad542b9c6cbdc85d22517cd0d151f38443 (patch)
treeb5b197c47476e88b9926852c73a84f24b6497c77 /src/collection/owned.rs
parent0140f58043a2a00312d31907253cc718985e1e6c (diff)
Unit testing
Diffstat (limited to 'src/collection/owned.rs')
-rw-r--r--src/collection/owned.rs17
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);
+ }
+}