about summary refs log tree commit diff
path: root/src/libcoretest/num/dec2flt
diff options
context:
space:
mode:
authorToby Scrace <toby.scrace@gmail.com>2016-01-03 20:08:53 +0000
committerToby Scrace <toby.scrace@gmail.com>2016-01-04 18:23:33 +0000
commit33f3c52d32e6f91494bc305fd25f9d5ae5a11702 (patch)
tree7fd8c5619b3d9b8d45374751d53681929a66c21f /src/libcoretest/num/dec2flt
parent543bb03d3ec864cfe47a9afd761101ea95f628f6 (diff)
Make float parsing "." return Err
This makes both of the following return Err:

    ".".parse::<f32>()
    ".".parse::<f64>()

This is a [breaking-change], which the libs team have classified as a
bug fix.
Diffstat (limited to 'src/libcoretest/num/dec2flt')
-rw-r--r--src/libcoretest/num/dec2flt/mod.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/libcoretest/num/dec2flt/mod.rs b/src/libcoretest/num/dec2flt/mod.rs
index 0c92b2fe2a7..7b25333e21e 100644
--- a/src/libcoretest/num/dec2flt/mod.rs
+++ b/src/libcoretest/num/dec2flt/mod.rs
@@ -98,7 +98,8 @@ fn fast_path_correct() {
 
 #[test]
 fn lonely_dot() {
-    assert_eq!(".".parse(), Ok(0.0));
+    assert!(".".parse::<f32>().is_err());
+    assert!(".".parse::<f64>().is_err());
 }
 
 #[test]