mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2025-01-05 06:48:42 +00:00
Iterator: Test that Iterator can be used in a for loop
`for x in foo` depends on foo implementing IntoIterator.
This commit is contained in:
parent
7a12c4d5e1
commit
105412b5a0
1 changed files with 9 additions and 0 deletions
|
@ -767,6 +767,15 @@ mod tests {
|
||||||
assert_eq!(it.next(), None);
|
assert_eq!(it.next(), None);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_into_iter() {
|
||||||
|
let mut v = vec![1i32, 2, 3].into_iter();
|
||||||
|
for x in Iterator::from_vec(vec![1i32, 2, 3]) {
|
||||||
|
assert_eq!(x.unwrap(), v.next().unwrap());
|
||||||
|
}
|
||||||
|
assert_eq!(v.next(), None);
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_std_resync_collect() {
|
fn test_std_resync_collect() {
|
||||||
use prelude::*;
|
use prelude::*;
|
||||||
|
|
Loading…
Reference in a new issue