Skip to content

Commit c0c9800

Browse files
committed
TEST: In sort test, check that we can look up each key in the sorted map.
1 parent 5adb025 commit c0c9800

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

tests/quick.rs

+9
Original file line numberDiff line numberDiff line change
@@ -286,8 +286,17 @@ quickcheck! {
286286
answer.reverse();
287287

288288
map.sort_by(|k1, _, k2, _| Ord::cmp(k1, k2));
289+
290+
// check it contains all the values it should
291+
for &(key, val) in &answer {
292+
assert_eq!(map[&key], val);
293+
}
294+
295+
// check the order
296+
289297
let mapv = Vec::from_iter(map);
290298
assert_eq!(answer, mapv);
299+
291300
}
292301

293302
fn sort_2(keyvals: Large<Vec<(i8, i8)>>) -> () {

0 commit comments

Comments
 (0)