diff options
| author | Yuki Okushi <huyuumi.dev@gmail.com> | 2021-01-11 12:10:16 +0900 |
|---|---|---|
| committer | Yuki Okushi <huyuumi.dev@gmail.com> | 2021-01-11 12:10:16 +0900 |
| commit | 39e1331cfabeef842081c599bebb6c10042008e7 (patch) | |
| tree | 1b7ecb8fc78a0f40cf1da551d1dbcbde58dab6c4 /library/alloc/src | |
| parent | c97f11af7bc4a6d3578f6a953be04ab2449a5728 (diff) | |
| download | rust-39e1331cfabeef842081c599bebb6c10042008e7.tar.gz rust-39e1331cfabeef842081c599bebb6c10042008e7.zip | |
Add another test case for #79808
Taken from #80293.
Diffstat (limited to 'library/alloc/src')
| -rw-r--r-- | library/alloc/src/collections/vec_deque/tests.rs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/library/alloc/src/collections/vec_deque/tests.rs b/library/alloc/src/collections/vec_deque/tests.rs index 21f52af056b..27dc59ae644 100644 --- a/library/alloc/src/collections/vec_deque/tests.rs +++ b/library/alloc/src/collections/vec_deque/tests.rs @@ -225,6 +225,21 @@ fn make_contiguous_head_to_end() { } #[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 // removal position is tested. Capacity 15 should be large enough to cover every case. |
