Skip to content

Commit 0f40cf1

Browse files
committed
Add a test for complex divide by zero.
1 parent 9d55421 commit 0f40cf1

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/libnum/complex.rs

+8
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,14 @@ mod test {
257257
assert_eq!(_1_0i.inv(), _1_0i.inv());
258258
}
259259

260+
#[test]
261+
#[should_fail]
262+
fn test_divide_by_zero_natural() {
263+
let n = Complex::new(2i, 3i);
264+
let d = Complex::new(0, 0);
265+
let _x = n / d;
266+
}
267+
260268
#[test]
261269
#[should_fail]
262270
#[ignore]

0 commit comments

Comments
 (0)