| 2160 | |
| 2161 | #[test] |
| 2162 | fn test_get_mut() { |
| 2163 | let mut tree = BPlusTreeMap::new(4).unwrap(); |
| 2164 | tree.insert(1, "one".to_string()); |
| 2165 | tree.insert(2, "two".to_string()); |
| 2166 | |
| 2167 | // Get a mutable reference and modify the value |
| 2168 | if let Some(value) = tree.get_mut(&1) { |
| 2169 | *value = "ONE".to_string(); |
| 2170 | } |
| 2171 | |
| 2172 | assert_eq!(tree.get(&1), Some(&"ONE".to_string())); |
| 2173 | assert_eq!(tree.get(&2), Some(&"two".to_string())); |
| 2174 | |
| 2175 | // Test with a non-existent key |
| 2176 | assert_eq!(tree.get_mut(&3), None); |
| 2177 | } |
| 2178 | |
| 2179 | #[test] |
| 2180 | fn test_arena_consistency() { |