add test for max value

This commit is contained in:
Djzin 2017-02-18 19:09:11 +00:00
parent 328818934b
commit 65c876f2d3

View File

@ -205,6 +205,14 @@ fn test_range_inclusive() {
check(map.range(-1...2), vec![(&0, &0), (&1, &1), (&2, &2)]);
}
#[test]
fn test_range_inclusive_max_value() {
let max = ::std::usize::MAX;
let map: BTreeMap<_, _> = vec![(max, 0)].into_iter().collect();
assert_eq!(map.range(max...max).collect::<Vec<_>>(), &[(&max, &0)]);
}
#[test]
fn test_range_equal_empty_cases() {
let map: BTreeMap<_, _> = (0..5).map(|i| (i, i)).collect();