use crate::test::types::Three; use enumoid::EnumMap; #[test] fn test_map() { let mut map = EnumMap::::new(); assert_eq!(*map.get(Three::B), 0); map[Three::B] = 200; assert_eq!(*map.get(Three::B), 200); *map.get_mut(Three::C) += 1; assert_eq!(*map.get(Three::C), 1); let collected: Vec<_> = map.iter().collect(); assert_eq!( collected, vec![(Three::A, &0), (Three::B, &200), (Three::C, &1)] ); }