Skip to content

Commit

Permalink
TEST: In sort test, check that we can look up each key in the sorted …
Browse files Browse the repository at this point in the history
…map.
  • Loading branch information
bluss committed Jan 4, 2018
1 parent 649608a commit f32a318
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/quick.rs
Original file line number Diff line number Diff line change
Expand Up @@ -286,8 +286,17 @@ quickcheck! {
answer.reverse();

map.sort_by(|k1, _, k2, _| Ord::cmp(k1, k2));

// check it contains all the values it should
for &(key, val) in &answer {
assert_eq!(map[&key], val);
}

// check the order

let mapv = Vec::from_iter(map);
assert_eq!(answer, mapv);

}

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

0 comments on commit f32a318

Please sign in to comment.