mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2024-11-25 19:11:06 +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
dcec895b30
commit
23fe9efe08
1 changed files with 9 additions and 0 deletions
|
@ -761,6 +761,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