Skip to content

Commit

Permalink
add test for max value
Browse files Browse the repository at this point in the history
  • Loading branch information
djzin committed Feb 18, 2017
1 parent 3288189 commit 65c876f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/libcollectionstest/btree/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 65c876f

Please sign in to comment.