Skip to content

Commit e908595

Browse files
committed
test: update tests for flt2dec fallouts.
1 parent 762e82e commit e908595

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/libserialize/json.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3019,9 +3019,9 @@ mod tests {
30193019
let v: i64 = super::decode("9223372036854775807").unwrap();
30203020
assert_eq!(v, i64::MAX);
30213021

3022-
let res: DecodeResult<i64> = super::decode("765.25252");
3022+
let res: DecodeResult<i64> = super::decode("765.25");
30233023
assert_eq!(res, Err(ExpectedError("Integer".to_string(),
3024-
"765.25252".to_string())));
3024+
"765.25".to_string())));
30253025
}
30263026

30273027
#[test]

src/test/run-pass/ifmt.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,10 @@ pub fn main() {
139139
t!(format!("{:e}", 1.2345e6f32), "1.2345e6");
140140
t!(format!("{:e}", 1.2345e6f64), "1.2345e6");
141141
t!(format!("{:E}", 1.2345e6f64), "1.2345E6");
142-
t!(format!("{:.3e}", 1.2345e6f64), "1.234e6");
143-
t!(format!("{:10.3e}", 1.2345e6f64), " 1.234e6");
144-
t!(format!("{:+10.3e}", 1.2345e6f64), " +1.234e6");
145-
t!(format!("{:+10.3e}", -1.2345e6f64), " -1.234e6");
142+
t!(format!("{:.3e}", 1.2345e6f64), "1.235e6");
143+
t!(format!("{:10.3e}", 1.2345e6f64), " 1.235e6");
144+
t!(format!("{:+10.3e}", 1.2345e6f64), " +1.235e6");
145+
t!(format!("{:+10.3e}", -1.2345e6f64), " -1.235e6");
146146

147147
// Float edge cases
148148
t!(format!("{}", -0.0), "0");

0 commit comments

Comments
 (0)