diff options
| author | bors <bors@rust-lang.org> | 2021-01-12 08:38:47 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2021-01-12 08:38:47 +0000 |
| commit | b6b461652a9bebfb4ddabcae896ee7237cf0962a (patch) | |
| tree | caa08d5e6f97757f4e3ba0fc5bc5879258d298ed /library/alloc/src/collections/vec_deque | |
| parent | 8234db5bc7b122dd9e39d738c30bcae005a96568 (diff) | |
| parent | 139daf564e47eae5c44445e959122ea5f80bb128 (diff) | |
Auto merge of #80939 - JohnTitor:rollup-pymns4q, r=JohnTitor
Rollup of 8 pull requests Successful merges: - #79757 (Replace tabs earlier in diagnostics) - #80600 (Add `MaybeUninit` method `array_assume_init`) - #80880 (Move some tests to more reasonable directories) - #80897 (driver: Use `atty` instead of rolling our own) - #80898 (Add another test case for #79808) - #80917 (core/slice: remove doc comment about scoped borrow) - #80927 (Replace a simple `if let` with the `matches` macro) - #80930 (fix typo in trait method mutability mismatch help) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'library/alloc/src/collections/vec_deque')
| -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. |
