Skip to content

Commit 39e1331

Browse files
committed
Add another test case for #79808
Taken from #80293.
1 parent c97f11a commit 39e1331

File tree

1 file changed

+15
-0
lines changed
  • library/alloc/src/collections/vec_deque

1 file changed

+15
-0
lines changed

library/alloc/src/collections/vec_deque/tests.rs

+15
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,21 @@ fn make_contiguous_head_to_end() {
224224
assert_eq!((&['A', 'B', 'C'] as &[_], &[] as &[_]), dq.as_slices());
225225
}
226226

227+
#[test]
228+
fn make_contiguous_head_to_end_2() {
229+
// Another test case for #79808, taken from #80293.
230+
231+
let mut dq = VecDeque::from_iter(0..6);
232+
dq.pop_front();
233+
dq.pop_front();
234+
dq.push_back(6);
235+
dq.push_back(7);
236+
dq.push_back(8);
237+
dq.make_contiguous();
238+
let collected: Vec<_> = dq.iter().copied().collect();
239+
assert_eq!(dq.as_slices(), (&collected[..], &[] as &[_]));
240+
}
241+
227242
#[test]
228243
fn test_remove() {
229244
// This test checks that every single combination of tail position, length, and

0 commit comments

Comments
 (0)