about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJonas Hietala <tradet.h@gmail.com>2014-08-13 12:52:50 +0200
committerJonas Hietala <tradet.h@gmail.com>2014-08-14 13:07:35 +0200
commit0f40cf1f5946dabf7652afa8ee7afb03d13af9bc (patch)
tree51088b03d69a101ebf2ae9f1d214e421ca385a05
parent9d554212de0398ac044e6d815da3bfb184831e77 (diff)
downloadrust-0f40cf1f5946dabf7652afa8ee7afb03d13af9bc.tar.gz
rust-0f40cf1f5946dabf7652afa8ee7afb03d13af9bc.zip
Add a test for complex divide by zero.
-rw-r--r--src/libnum/complex.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/libnum/complex.rs b/src/libnum/complex.rs
index f4a3ac97a4e..66412eb678f 100644
--- a/src/libnum/complex.rs
+++ b/src/libnum/complex.rs
@@ -259,6 +259,14 @@ mod test {
 
     #[test]
     #[should_fail]
+    fn test_divide_by_zero_natural() {
+        let n = Complex::new(2i, 3i);
+        let d = Complex::new(0, 0);
+        let _x = n / d;
+    }
+
+    #[test]
+    #[should_fail]
     #[ignore]
     fn test_inv_zero() {
         // FIXME #5736: should this really fail, or just NaN?