@@ -305,20 +305,20 @@ fn debug_formatting_millis() {
305305
306306#[ test]
307307fn debug_formatting_micros ( ) {
308- assert_eq ! ( format!( "{:?}" , Duration :: new( 0 , 7_000 ) ) , "7µs " ) ;
309- assert_eq ! ( format!( "{:?}" , Duration :: new( 0 , 7_100 ) ) , "7.1µs " ) ;
310- assert_eq ! ( format!( "{:?}" , Duration :: new( 0 , 7_001 ) ) , "7.001µs " ) ;
311- assert_eq ! ( format!( "{:?}" , Duration :: new( 0 , 7_123 ) ) , "7.123µs " ) ;
308+ assert_eq ! ( format!( "{:?}" , Duration :: new( 0 , 7_000 ) ) , "7μs " ) ;
309+ assert_eq ! ( format!( "{:?}" , Duration :: new( 0 , 7_100 ) ) , "7.1μs " ) ;
310+ assert_eq ! ( format!( "{:?}" , Duration :: new( 0 , 7_001 ) ) , "7.001μs " ) ;
311+ assert_eq ! ( format!( "{:?}" , Duration :: new( 0 , 7_123 ) ) , "7.123μs " ) ;
312312
313- assert_eq ! ( format!( "{:?}" , Duration :: new( 0 , 88_000 ) ) , "88µs " ) ;
314- assert_eq ! ( format!( "{:?}" , Duration :: new( 0 , 88_100 ) ) , "88.1µs " ) ;
315- assert_eq ! ( format!( "{:?}" , Duration :: new( 0 , 88_001 ) ) , "88.001µs " ) ;
316- assert_eq ! ( format!( "{:?}" , Duration :: new( 0 , 88_123 ) ) , "88.123µs " ) ;
313+ assert_eq ! ( format!( "{:?}" , Duration :: new( 0 , 88_000 ) ) , "88μs " ) ;
314+ assert_eq ! ( format!( "{:?}" , Duration :: new( 0 , 88_100 ) ) , "88.1μs " ) ;
315+ assert_eq ! ( format!( "{:?}" , Duration :: new( 0 , 88_001 ) ) , "88.001μs " ) ;
316+ assert_eq ! ( format!( "{:?}" , Duration :: new( 0 , 88_123 ) ) , "88.123μs " ) ;
317317
318- assert_eq ! ( format!( "{:?}" , Duration :: new( 0 , 999_000 ) ) , "999µs " ) ;
319- assert_eq ! ( format!( "{:?}" , Duration :: new( 0 , 999_100 ) ) , "999.1µs " ) ;
320- assert_eq ! ( format!( "{:?}" , Duration :: new( 0 , 999_001 ) ) , "999.001µs " ) ;
321- assert_eq ! ( format!( "{:?}" , Duration :: new( 0 , 999_123 ) ) , "999.123µs " ) ;
318+ assert_eq ! ( format!( "{:?}" , Duration :: new( 0 , 999_000 ) ) , "999μs " ) ;
319+ assert_eq ! ( format!( "{:?}" , Duration :: new( 0 , 999_100 ) ) , "999.1μs " ) ;
320+ assert_eq ! ( format!( "{:?}" , Duration :: new( 0 , 999_001 ) ) , "999.001μs " ) ;
321+ assert_eq ! ( format!( "{:?}" , Duration :: new( 0 , 999_123 ) ) , "999.123μs " ) ;
322322}
323323
324324#[ test]
@@ -334,10 +334,10 @@ fn debug_formatting_precision_zero() {
334334 assert_eq ! ( format!( "{:.0?}" , Duration :: new( 0 , 0 ) ) , "0ns" ) ;
335335 assert_eq ! ( format!( "{:.0?}" , Duration :: new( 0 , 123 ) ) , "123ns" ) ;
336336
337- assert_eq ! ( format!( "{:.0?}" , Duration :: new( 0 , 1_001 ) ) , "1µs " ) ;
338- assert_eq ! ( format!( "{:.0?}" , Duration :: new( 0 , 1_499 ) ) , "1µs " ) ;
339- assert_eq ! ( format!( "{:.0?}" , Duration :: new( 0 , 1_500 ) ) , "2µs " ) ;
340- assert_eq ! ( format!( "{:.0?}" , Duration :: new( 0 , 1_999 ) ) , "2µs " ) ;
337+ assert_eq ! ( format!( "{:.0?}" , Duration :: new( 0 , 1_001 ) ) , "1μs " ) ;
338+ assert_eq ! ( format!( "{:.0?}" , Duration :: new( 0 , 1_499 ) ) , "1μs " ) ;
339+ assert_eq ! ( format!( "{:.0?}" , Duration :: new( 0 , 1_500 ) ) , "2μs " ) ;
340+ assert_eq ! ( format!( "{:.0?}" , Duration :: new( 0 , 1_999 ) ) , "2μs " ) ;
341341
342342 assert_eq ! ( format!( "{:.0?}" , Duration :: new( 0 , 1_000_001 ) ) , "1ms" ) ;
343343 assert_eq ! ( format!( "{:.0?}" , Duration :: new( 0 , 1_499_999 ) ) , "1ms" ) ;
@@ -355,12 +355,12 @@ fn debug_formatting_precision_two() {
355355 assert_eq ! ( format!( "{:.2?}" , Duration :: new( 0 , 0 ) ) , "0.00ns" ) ;
356356 assert_eq ! ( format!( "{:.2?}" , Duration :: new( 0 , 123 ) ) , "123.00ns" ) ;
357357
358- assert_eq ! ( format!( "{:.2?}" , Duration :: new( 0 , 1_000 ) ) , "1.00µs " ) ;
359- assert_eq ! ( format!( "{:.2?}" , Duration :: new( 0 , 7_001 ) ) , "7.00µs " ) ;
360- assert_eq ! ( format!( "{:.2?}" , Duration :: new( 0 , 7_100 ) ) , "7.10µs " ) ;
361- assert_eq ! ( format!( "{:.2?}" , Duration :: new( 0 , 7_109 ) ) , "7.11µs " ) ;
362- assert_eq ! ( format!( "{:.2?}" , Duration :: new( 0 , 7_199 ) ) , "7.20µs " ) ;
363- assert_eq ! ( format!( "{:.2?}" , Duration :: new( 0 , 1_999 ) ) , "2.00µs " ) ;
358+ assert_eq ! ( format!( "{:.2?}" , Duration :: new( 0 , 1_000 ) ) , "1.00μs " ) ;
359+ assert_eq ! ( format!( "{:.2?}" , Duration :: new( 0 , 7_001 ) ) , "7.00μs " ) ;
360+ assert_eq ! ( format!( "{:.2?}" , Duration :: new( 0 , 7_100 ) ) , "7.10μs " ) ;
361+ assert_eq ! ( format!( "{:.2?}" , Duration :: new( 0 , 7_109 ) ) , "7.11μs " ) ;
362+ assert_eq ! ( format!( "{:.2?}" , Duration :: new( 0 , 7_199 ) ) , "7.20μs " ) ;
363+ assert_eq ! ( format!( "{:.2?}" , Duration :: new( 0 , 1_999 ) ) , "2.00μs " ) ;
364364
365365 assert_eq ! ( format!( "{:.2?}" , Duration :: new( 0 , 1_000_000 ) ) , "1.00ms" ) ;
366366 assert_eq ! ( format!( "{:.2?}" , Duration :: new( 0 , 3_001_000 ) ) , "3.00ms" ) ;
@@ -386,9 +386,9 @@ fn debug_formatting_padding() {
386386 assert_eq ! ( "123.0ns " , format!( "{:<9.1?}" , Duration :: new( 0 , 123 ) ) ) ;
387387 assert_eq ! ( " 123.0ns" , format!( "{:>9.1?}" , Duration :: new( 0 , 123 ) ) ) ;
388388 assert_eq ! ( " 123.0ns " , format!( "{:^9.1?}" , Duration :: new( 0 , 123 ) ) ) ;
389- assert_eq ! ( "7.1µs " , format!( "{:<9?}" , Duration :: new( 0 , 7_100 ) ) ) ;
390- assert_eq ! ( " 7.1µs " , format!( "{:>9?}" , Duration :: new( 0 , 7_100 ) ) ) ;
391- assert_eq ! ( " 7.1µs " , format!( "{:^9?}" , Duration :: new( 0 , 7_100 ) ) ) ;
389+ assert_eq ! ( "7.1μs " , format!( "{:<9?}" , Duration :: new( 0 , 7_100 ) ) ) ;
390+ assert_eq ! ( " 7.1μs " , format!( "{:>9?}" , Duration :: new( 0 , 7_100 ) ) ) ;
391+ assert_eq ! ( " 7.1μs " , format!( "{:^9?}" , Duration :: new( 0 , 7_100 ) ) ) ;
392392 assert_eq ! ( "999.123456ms" , format!( "{:<9?}" , Duration :: new( 0 , 999_123_456 ) ) ) ;
393393 assert_eq ! ( "999.123456ms" , format!( "{:>9?}" , Duration :: new( 0 , 999_123_456 ) ) ) ;
394394 assert_eq ! ( "999.123456ms" , format!( "{:^9?}" , Duration :: new( 0 , 999_123_456 ) ) ) ;
@@ -405,7 +405,7 @@ fn debug_formatting_padding() {
405405
406406#[ test]
407407fn debug_formatting_precision_high ( ) {
408- assert_eq ! ( format!( "{:.5?}" , Duration :: new( 0 , 23_678 ) ) , "23.67800µs " ) ;
408+ assert_eq ! ( format!( "{:.5?}" , Duration :: new( 0 , 23_678 ) ) , "23.67800μs " ) ;
409409
410410 assert_eq ! ( format!( "{:.9?}" , Duration :: new( 1 , 000_000_000 ) ) , "1.000000000s" ) ;
411411 assert_eq ! ( format!( "{:.10?}" , Duration :: new( 4 , 001_000_000 ) ) , "4.0010000000s" ) ;
0 commit comments