test: update tests for flt2dec fallouts.
This commit is contained in:
parent
f9bfda0a6f
commit
85424c4bae
2 changed files with 6 additions and 6 deletions
|
@ -3011,9 +3011,9 @@ mod tests {
|
||||||
let v: i64 = super::decode("9223372036854775807").unwrap();
|
let v: i64 = super::decode("9223372036854775807").unwrap();
|
||||||
assert_eq!(v, i64::MAX);
|
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(),
|
assert_eq!(res, Err(ExpectedError("Integer".to_string(),
|
||||||
"765.25252".to_string())));
|
"765.25".to_string())));
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|
|
@ -138,10 +138,10 @@ pub fn main() {
|
||||||
t!(format!("{:e}", 1.2345e6f32), "1.2345e6");
|
t!(format!("{:e}", 1.2345e6f32), "1.2345e6");
|
||||||
t!(format!("{:e}", 1.2345e6f64), "1.2345e6");
|
t!(format!("{:e}", 1.2345e6f64), "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!("{:.3e}", 1.2345e6f64), "1.235e6");
|
||||||
t!(format!("{:10.3e}", 1.2345e6f64), " 1.234e6");
|
t!(format!("{:10.3e}", 1.2345e6f64), " 1.235e6");
|
||||||
t!(format!("{:+10.3e}", 1.2345e6f64), " +1.234e6");
|
t!(format!("{:+10.3e}", 1.2345e6f64), " +1.235e6");
|
||||||
t!(format!("{:+10.3e}", -1.2345e6f64), " -1.234e6");
|
t!(format!("{:+10.3e}", -1.2345e6f64), " -1.235e6");
|
||||||
|
|
||||||
// Float edge cases
|
// Float edge cases
|
||||||
t!(format!("{}", -0.0), "0");
|
t!(format!("{}", -0.0), "0");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue