mirror of https://github.com/KaiserY/trpl-zh-cn
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
374 B
17 lines
374 B
#[cfg(test)]
|
|
mod tests {
|
|
// ANCHOR: here
|
|
#[test]
|
|
fn iterator_demonstration() {
|
|
let v1 = vec![1, 2, 3];
|
|
|
|
let mut v1_iter = v1.iter();
|
|
|
|
assert_eq!(v1_iter.next(), Some(&1));
|
|
assert_eq!(v1_iter.next(), Some(&2));
|
|
assert_eq!(v1_iter.next(), Some(&3));
|
|
assert_eq!(v1_iter.next(), None);
|
|
}
|
|
// ANCHOR_END: here
|
|
}
|