mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-03 17:35:28 +03:00
test: update tests for flt2dec fallouts.
This commit is contained in:
@@ -3011,9 +3011,9 @@ fn test_decode_numbers() {
|
||||
let v: i64 = super::decode("9223372036854775807").unwrap();
|
||||
assert_eq!(v, i64::MAX);
|
||||
|
||||
let res: DecodeResult<i64> = super::decode("765.25252");
|
||||
let res: DecodeResult<i64> = super::decode("765.25");
|
||||
assert_eq!(res, Err(ExpectedError("Integer".to_string(),
|
||||
"765.25252".to_string())));
|
||||
"765.25".to_string())));
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
@@ -138,10 +138,10 @@ pub fn main() {
|
||||
t!(format!("{:e}", 1.2345e6f32), "1.2345e6");
|
||||
t!(format!("{:e}", 1.2345e6f64), "1.2345e6");
|
||||
t!(format!("{:E}", 1.2345e6f64), "1.2345E6");
|
||||
t!(format!("{:.3e}", 1.2345e6f64), "1.234e6");
|
||||
t!(format!("{:10.3e}", 1.2345e6f64), " 1.234e6");
|
||||
t!(format!("{:+10.3e}", 1.2345e6f64), " +1.234e6");
|
||||
t!(format!("{:+10.3e}", -1.2345e6f64), " -1.234e6");
|
||||
t!(format!("{:.3e}", 1.2345e6f64), "1.235e6");
|
||||
t!(format!("{:10.3e}", 1.2345e6f64), " 1.235e6");
|
||||
t!(format!("{:+10.3e}", 1.2345e6f64), " +1.235e6");
|
||||
t!(format!("{:+10.3e}", -1.2345e6f64), " -1.235e6");
|
||||
|
||||
// Float edge cases
|
||||
t!(format!("{}", -0.0), "0");
|
||||
|
||||
Reference in New Issue
Block a user