Skip to content

Commit f549f30

Browse files
termoshttcuviper
authored andcommitted
Add test of Sum/Product
1 parent e5e53fb commit f549f30

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/lib.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1958,4 +1958,18 @@ mod test {
19581958
test("1i - 2i");
19591959
test("+ 1 - 3.0i");
19601960
}
1961+
1962+
#[test]
1963+
fn test_sum() {
1964+
let v = vec![_0_1i, _4_2i, _1_0i, _1_1i];
1965+
let _: Complex64 = v.iter().sum();
1966+
let _: Complex64 = v.into_iter().sum();
1967+
}
1968+
1969+
#[test]
1970+
fn test_prod() {
1971+
let v = vec![_0_1i, _4_2i, _1_0i, _1_1i];
1972+
let _: Complex64 = v.iter().product();
1973+
let _: Complex64 = v.into_iter().product();
1974+
}
19611975
}

0 commit comments

Comments
 (0)