about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorDjzin <djzin@users.noreply.github.com>2017-02-18 19:09:11 +0000
committerDjzin <djzin@users.noreply.github.com>2017-02-18 19:09:11 +0000
commit65c876f2d30ddbd316849dc9092eb2b7b20bdff9 (patch)
tree23416c4fa7ab30165134f7c0a71bda3e7840ee13 /src
parent328818934b3cc3a19c29fd4f87f165808bf9c037 (diff)
downloadrust-65c876f2d30ddbd316849dc9092eb2b7b20bdff9.tar.gz
rust-65c876f2d30ddbd316849dc9092eb2b7b20bdff9.zip
add test for max value
Diffstat (limited to 'src')
-rw-r--r--src/libcollectionstest/btree/map.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/libcollectionstest/btree/map.rs b/src/libcollectionstest/btree/map.rs
index 9d8895b79da..0fa73b19343 100644
--- a/src/libcollectionstest/btree/map.rs
+++ b/src/libcollectionstest/btree/map.rs
@@ -206,6 +206,14 @@ fn test_range_inclusive() {
 }
 
 #[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();
     assert_eq!(map.range((Included(2), Excluded(2))).next(), None);