add regression test
This commit is contained in:
parent
60a900ee10
commit
a44a059c3b
1 changed files with 12 additions and 0 deletions
|
@ -1094,6 +1094,18 @@ fn test_from_iter_specialization_panic_during_drop_leaks() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// regression test for issue #85322. Peekable previously implemented InPlaceIterable,
|
||||||
|
// but due to an interaction with IntoIter's current Clone implementation it failed to uphold
|
||||||
|
// the contract.
|
||||||
|
#[test]
|
||||||
|
fn test_collect_after_iterator_clone() {
|
||||||
|
let v = vec![0; 5];
|
||||||
|
let mut i = v.into_iter().peekable();
|
||||||
|
i.peek();
|
||||||
|
let v = i.clone().collect::<Vec<_>>();
|
||||||
|
assert!(v.len() <= v.capacity());
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_cow_from() {
|
fn test_cow_from() {
|
||||||
let borrowed: &[_] = &["borrowed", "(slice)"];
|
let borrowed: &[_] = &["borrowed", "(slice)"];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue