additional specializations tests
This commit is contained in:
parent
00a32eb54f
commit
2b0b2ae9f6
@ -785,6 +785,28 @@ fn test_from_iter_specialization() {
|
|||||||
assert_eq!(srcptr, sinkptr);
|
assert_eq!(srcptr, sinkptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_from_iter_partially_drained_in_place_specialization() {
|
||||||
|
let src: Vec<usize> = vec![0usize; 10];
|
||||||
|
let srcptr = src.as_ptr();
|
||||||
|
let mut iter = src.into_iter();
|
||||||
|
iter.next();
|
||||||
|
iter.next();
|
||||||
|
let sink = iter.collect::<Vec<_>>();
|
||||||
|
let sinkptr = sink.as_ptr();
|
||||||
|
assert_eq!(srcptr, sinkptr);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_extend_in_place_specialization() {
|
||||||
|
let src: Vec<usize> = vec![0usize; 1];
|
||||||
|
let srcptr = src.as_ptr();
|
||||||
|
let mut dst = Vec::new();
|
||||||
|
dst.extend(src.into_iter());
|
||||||
|
let dstptr = dst.as_ptr();
|
||||||
|
assert_eq!(srcptr, dstptr);
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_from_iter_specialization_with_iterator_adapters() {
|
fn test_from_iter_specialization_with_iterator_adapters() {
|
||||||
fn assert_in_place_trait<T: InPlaceIterable>(_: &T) {};
|
fn assert_in_place_trait<T: InPlaceIterable>(_: &T) {};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user