@@ -355,7 +355,7 @@ mod tests {
355
355
/// Valid even on strict mode.
356
356
const VALID_CASES : & [ & str ] = & [ ".0" , "0.e-1" , "0e8" , ".8e1" , "0.8e1" , "1.18e1" ] ;
357
357
const INVALID_CASES_ON_STRICT : & [ & str ] = & [ "08e1" , "08.1" , "08.8e1" , "08" , "01" ] ;
358
- const INVALID_CASES : & [ & str ] = & [ ".e-1" , " 01.8e1", "012e1" , "00e1" , "00.0" ] ;
358
+ const INVALID_CASES : & [ & str ] = & [ "01.8e1" , "012e1" , "00e1" , "00.0" ] ;
359
359
360
360
fn test_floats ( strict : bool , success : bool , cases : & ' static [ & ' static str ] ) {
361
361
for case in cases {
@@ -367,7 +367,12 @@ mod tests {
367
367
let expected: f64 = ( i64:: from_str_radix ( case, 8 ) . map ( |v| v as f64 ) )
368
368
. or_else ( |_| case. parse :: < i64 > ( ) . map ( |v| v as f64 ) )
369
369
. or_else ( |_| case. parse :: < f64 > ( ) )
370
- . expect ( "failed to parse `expected` as float using str.parse()" ) ;
370
+ . unwrap_or_else ( |err| {
371
+ panic ! (
372
+ "failed to parse '{}' as float using str.parse(): {}" ,
373
+ case, err
374
+ )
375
+ } ) ;
371
376
372
377
let vec = panic:: catch_unwind ( || {
373
378
:: with_test_sess ( case, |mut sess, input| {
0 commit comments