Asserts that the map behaves consistently as an empty map.
(map: &mut Map<N, { M }>, key: &K, val: V)
| 211 | |
| 212 | /// Asserts that the map behaves consistently as an empty map. |
| 213 | fn assert_empty<const N: usize, const M: usize>(map: &mut Map<N, { M }>, key: &K, val: V) { |
| 214 | assert!(map.is_empty()); |
| 215 | assert_eq!(map.len(), 0); |
| 216 | |
| 217 | assert_eq!(map.iter().count(), 0); |
| 218 | assert_eq!(map.keys().count(), 0); |
| 219 | assert_eq!(map.values().count(), 0); |
| 220 | |
| 221 | assert_eq!(Map::<N, M>::key_pos(&[], key), None); |
| 222 | assert!(!map.contains_key(key)); |
| 223 | assert_eq!(map.get(key), None); |
| 224 | assert_eq!(map.get_mut(key), None); |
| 225 | |
| 226 | assert_eq!(map.remove(key), None); |
| 227 | assert_eq!(map.insert(*key, val), None); |
| 228 | } |
| 229 | |
| 230 | /// Asserts that the map behaves consistently as a non-empty map. |
| 231 | fn assert_not_empty<const N: usize, const M: usize>(map: &mut Map<N, M>, len: usize) { |
no outgoing calls
no test coverage detected
searching dependent graphs…