Skip to content

Commit 64e48df

Browse files
committed
Add test of Sum/Product
1 parent 559536b commit 64e48df

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
@@ -1935,4 +1935,18 @@ mod test {
19351935
test("1i - 2i");
19361936
test("+ 1 - 3.0i");
19371937
}
1938+
1939+
#[test]
1940+
fn test_sum() {
1941+
let v = vec![_0_1i, _4_2i, _1_0i, _1_1i];
1942+
let _: Complex64 = v.iter().sum();
1943+
let _: Complex64 = v.into_iter().sum();
1944+
}
1945+
1946+
#[test]
1947+
fn test_prod() {
1948+
let v = vec![_0_1i, _4_2i, _1_0i, _1_1i];
1949+
let _: Complex64 = v.iter().product();
1950+
let _: Complex64 = v.into_iter().product();
1951+
}
19381952
}

0 commit comments

Comments
 (0)