Skip to content

Commit

Permalink
Rollup merge of #80898 - JohnTitor:vecdeque-another-case, r=lcnr
Browse files Browse the repository at this point in the history
Add another test case for #79808

Taken from #80293.
Closes #80293

r? `@lcnr`
  • Loading branch information
JohnTitor authored Jan 12, 2021
2 parents d682a68 + 39e1331 commit a9e3125
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions library/alloc/src/collections/vec_deque/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,21 @@ fn make_contiguous_head_to_end() {
assert_eq!((&['A', 'B', 'C'] as &[_], &[] as &[_]), dq.as_slices());
}

#[test]
fn make_contiguous_head_to_end_2() {
// Another test case for #79808, taken from #80293.

let mut dq = VecDeque::from_iter(0..6);
dq.pop_front();
dq.pop_front();
dq.push_back(6);
dq.push_back(7);
dq.push_back(8);
dq.make_contiguous();
let collected: Vec<_> = dq.iter().copied().collect();
assert_eq!(dq.as_slices(), (&collected[..], &[] as &[_]));
}

#[test]
fn test_remove() {
// This test checks that every single combination of tail position, length, and
Expand Down

0 comments on commit a9e3125

Please sign in to comment.