12345678910111213141516 |
- use mini_avl::Set;
- #[test]
- fn test_count() {
- let mut set = Set::new();
- for i in 1..11 {
- assert!(set.insert(i));
- assert_eq!(set.count(), i);
- }
- for i in 1..11 {
- assert_eq!(set.count_lt(&i), i - 1);
- assert_eq!(set.count_le(&i), i);
- assert_eq!(set.count_ge(&i), 11 - i);
- assert_eq!(set.count_gt(&i), 10 - i);
- }
- }
|