]> git.lizzy.rs Git - rust.git/commitdiff
Enable unit tests for literals that overflow. I have no idea why this condition was...
authorRobin Kruppe <robin.kruppe@gmail.com>
Thu, 4 Feb 2016 12:51:18 +0000 (13:51 +0100)
committerRobin Kruppe <robin.kruppe@gmail.com>
Thu, 4 Feb 2016 15:28:07 +0000 (16:28 +0100)
src/libcoretest/num/dec2flt/mod.rs

index a96c29575685b2efb2cf03c1785c6c7f5d747a0f..fe6f52406fbc834406485e732d1583407f38f9ec 100644 (file)
@@ -25,13 +25,11 @@ macro_rules! test_literal {
         let x64: f64 = $x;
         let inputs = &[stringify!($x).into(), format!("{:?}", x64), format!("{:e}", x64)];
         for input in inputs {
-            if input != "inf" {
-                assert_eq!(input.parse(), Ok(x64));
-                assert_eq!(input.parse(), Ok(x32));
-                let neg_input = &format!("-{}", input);
-                assert_eq!(neg_input.parse(), Ok(-x64));
-                assert_eq!(neg_input.parse(), Ok(-x32));
-            }
+            assert_eq!(input.parse(), Ok(x64));
+            assert_eq!(input.parse(), Ok(x32));
+            let neg_input = &format!("-{}", input);
+            assert_eq!(neg_input.parse(), Ok(-x64));
+            assert_eq!(neg_input.parse(), Ok(-x32));
         }
     })
 }