diff options
| author | Toby Scrace <toby.scrace@gmail.com> | 2016-01-03 20:08:53 +0000 |
|---|---|---|
| committer | Toby Scrace <toby.scrace@gmail.com> | 2016-01-04 18:23:33 +0000 |
| commit | 33f3c52d32e6f91494bc305fd25f9d5ae5a11702 (patch) | |
| tree | 7fd8c5619b3d9b8d45374751d53681929a66c21f /src/libcoretest/num/dec2flt | |
| parent | 543bb03d3ec864cfe47a9afd761101ea95f628f6 (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.rs | 3 |
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] |
