Skip to content

Commit 65c876f

Browse files
committed
add test for max value
1 parent 3288189 commit 65c876f

File tree

1 file changed

+8
-0
lines changed
  • src/libcollectionstest/btree

1 file changed

+8
-0
lines changed

src/libcollectionstest/btree/map.rs

+8
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,14 @@ fn test_range_inclusive() {
205205
check(map.range(-1...2), vec![(&0, &0), (&1, &1), (&2, &2)]);
206206
}
207207

208+
#[test]
209+
fn test_range_inclusive_max_value() {
210+
let max = ::std::usize::MAX;
211+
let map: BTreeMap<_, _> = vec![(max, 0)].into_iter().collect();
212+
213+
assert_eq!(map.range(max...max).collect::<Vec<_>>(), &[(&max, &0)]);
214+
}
215+
208216
#[test]
209217
fn test_range_equal_empty_cases() {
210218
let map: BTreeMap<_, _> = (0..5).map(|i| (i, i)).collect();

0 commit comments

Comments
 (0)