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.
16 lines
251 B
16 lines
251 B
2 years ago
|
#[cfg(test)]
|
||
|
mod tests {
|
||
|
// ANCHOR: here
|
||
|
#[test]
|
||
|
fn iterator_sum() {
|
||
|
let v1 = vec![1, 2, 3];
|
||
|
|
||
|
let v1_iter = v1.iter();
|
||
|
|
||
|
let total: i32 = v1_iter.sum();
|
||
|
|
||
|
assert_eq!(total, 6);
|
||
|
}
|
||
|
// ANCHOR_END: here
|
||
|
}
|