@@ -1564,8 +1564,8 @@ mod tests {
1564
1564
1565
1565
debug ! ( "test_ctime: {} {}" , utc. asctime( ) , local. asctime( ) ) ;
1566
1566
1567
- assert_eq ! ( utc. asctime( ) . to_string( ) , "Fri Feb 13 23:31:30 2009" . to_string ( ) ) ;
1568
- assert_eq ! ( local. asctime( ) . to_string( ) , "Fri Feb 13 15:31:30 2009" . to_string ( ) ) ;
1567
+ assert_eq ! ( utc. asctime( ) . to_string( ) , "Fri Feb 13 23:31:30 2009" ) ;
1568
+ assert_eq ! ( local. asctime( ) . to_string( ) , "Fri Feb 13 15:31:30 2009" ) ;
1569
1569
}
1570
1570
1571
1571
fn test_ctime ( ) {
@@ -1577,8 +1577,8 @@ mod tests {
1577
1577
1578
1578
debug ! ( "test_ctime: {} {}" , utc. ctime( ) , local. ctime( ) ) ;
1579
1579
1580
- assert_eq ! ( utc. ctime( ) . to_string( ) , "Fri Feb 13 15:31:30 2009" . to_string ( ) ) ;
1581
- assert_eq ! ( local. ctime( ) . to_string( ) , "Fri Feb 13 15:31:30 2009" . to_string ( ) ) ;
1580
+ assert_eq ! ( utc. ctime( ) . to_string( ) , "Fri Feb 13 15:31:30 2009" ) ;
1581
+ assert_eq ! ( local. ctime( ) . to_string( ) , "Fri Feb 13 15:31:30 2009" ) ;
1582
1582
}
1583
1583
1584
1584
fn test_strftime ( ) {
@@ -1588,56 +1588,56 @@ mod tests {
1588
1588
let utc = at_utc ( time) ;
1589
1589
let local = at ( time) ;
1590
1590
1591
- assert_eq ! ( local. strftime( "" ) . unwrap( ) . to_string( ) , "" . to_string ( ) ) ;
1592
- assert_eq ! ( local. strftime( "%A" ) . unwrap( ) . to_string( ) , "Friday" . to_string ( ) ) ;
1593
- assert_eq ! ( local. strftime( "%a" ) . unwrap( ) . to_string( ) , "Fri" . to_string ( ) ) ;
1594
- assert_eq ! ( local. strftime( "%B" ) . unwrap( ) . to_string( ) , "February" . to_string ( ) ) ;
1595
- assert_eq ! ( local. strftime( "%b" ) . unwrap( ) . to_string( ) , "Feb" . to_string ( ) ) ;
1596
- assert_eq ! ( local. strftime( "%C" ) . unwrap( ) . to_string( ) , "20" . to_string ( ) ) ;
1591
+ assert_eq ! ( local. strftime( "" ) . unwrap( ) . to_string( ) , "" ) ;
1592
+ assert_eq ! ( local. strftime( "%A" ) . unwrap( ) . to_string( ) , "Friday" ) ;
1593
+ assert_eq ! ( local. strftime( "%a" ) . unwrap( ) . to_string( ) , "Fri" ) ;
1594
+ assert_eq ! ( local. strftime( "%B" ) . unwrap( ) . to_string( ) , "February" ) ;
1595
+ assert_eq ! ( local. strftime( "%b" ) . unwrap( ) . to_string( ) , "Feb" ) ;
1596
+ assert_eq ! ( local. strftime( "%C" ) . unwrap( ) . to_string( ) , "20" ) ;
1597
1597
assert_eq ! ( local. strftime( "%c" ) . unwrap( ) . to_string( ) ,
1598
- "Fri Feb 13 15:31:30 2009" . to_string ( ) ) ;
1599
- assert_eq ! ( local. strftime( "%D" ) . unwrap( ) . to_string( ) , "02/13/09" . to_string ( ) ) ;
1600
- assert_eq ! ( local. strftime( "%d" ) . unwrap( ) . to_string( ) , "13" . to_string ( ) ) ;
1601
- assert_eq ! ( local. strftime( "%e" ) . unwrap( ) . to_string( ) , "13" . to_string ( ) ) ;
1602
- assert_eq ! ( local. strftime( "%F" ) . unwrap( ) . to_string( ) , "2009-02-13" . to_string ( ) ) ;
1603
- assert_eq ! ( local. strftime( "%f" ) . unwrap( ) . to_string( ) , "000054321" . to_string ( ) ) ;
1604
- assert_eq ! ( local. strftime( "%G" ) . unwrap( ) . to_string( ) , "2009" . to_string ( ) ) ;
1605
- assert_eq ! ( local. strftime( "%g" ) . unwrap( ) . to_string( ) , "09" . to_string ( ) ) ;
1606
- assert_eq ! ( local. strftime( "%H" ) . unwrap( ) . to_string( ) , "15" . to_string ( ) ) ;
1607
- assert_eq ! ( local. strftime( "%h" ) . unwrap( ) . to_string( ) , "Feb" . to_string ( ) ) ;
1608
- assert_eq ! ( local. strftime( "%I" ) . unwrap( ) . to_string( ) , "03" . to_string ( ) ) ;
1609
- assert_eq ! ( local. strftime( "%j" ) . unwrap( ) . to_string( ) , "044" . to_string ( ) ) ;
1610
- assert_eq ! ( local. strftime( "%k" ) . unwrap( ) . to_string( ) , "15" . to_string ( ) ) ;
1611
- assert_eq ! ( local. strftime( "%l" ) . unwrap( ) . to_string( ) , " 3" . to_string ( ) ) ;
1612
- assert_eq ! ( local. strftime( "%M" ) . unwrap( ) . to_string( ) , "31" . to_string ( ) ) ;
1613
- assert_eq ! ( local. strftime( "%m" ) . unwrap( ) . to_string( ) , "02" . to_string ( ) ) ;
1614
- assert_eq ! ( local. strftime( "%n" ) . unwrap( ) . to_string( ) , "\n " . to_string ( ) ) ;
1615
- assert_eq ! ( local. strftime( "%P" ) . unwrap( ) . to_string( ) , "pm" . to_string ( ) ) ;
1616
- assert_eq ! ( local. strftime( "%p" ) . unwrap( ) . to_string( ) , "PM" . to_string ( ) ) ;
1617
- assert_eq ! ( local. strftime( "%R" ) . unwrap( ) . to_string( ) , "15:31" . to_string ( ) ) ;
1618
- assert_eq ! ( local. strftime( "%r" ) . unwrap( ) . to_string( ) , "03:31:30 PM" . to_string ( ) ) ;
1619
- assert_eq ! ( local. strftime( "%S" ) . unwrap( ) . to_string( ) , "30" . to_string ( ) ) ;
1620
- assert_eq ! ( local. strftime( "%s" ) . unwrap( ) . to_string( ) , "1234567890" . to_string ( ) ) ;
1621
- assert_eq ! ( local. strftime( "%T" ) . unwrap( ) . to_string( ) , "15:31:30" . to_string ( ) ) ;
1622
- assert_eq ! ( local. strftime( "%t" ) . unwrap( ) . to_string( ) , "\t " . to_string ( ) ) ;
1623
- assert_eq ! ( local. strftime( "%U" ) . unwrap( ) . to_string( ) , "06" . to_string ( ) ) ;
1624
- assert_eq ! ( local. strftime( "%u" ) . unwrap( ) . to_string( ) , "5" . to_string ( ) ) ;
1625
- assert_eq ! ( local. strftime( "%V" ) . unwrap( ) . to_string( ) , "07" . to_string ( ) ) ;
1626
- assert_eq ! ( local. strftime( "%v" ) . unwrap( ) . to_string( ) , "13-Feb-2009" . to_string ( ) ) ;
1627
- assert_eq ! ( local. strftime( "%W" ) . unwrap( ) . to_string( ) , "06" . to_string ( ) ) ;
1628
- assert_eq ! ( local. strftime( "%w" ) . unwrap( ) . to_string( ) , "5" . to_string ( ) ) ;
1598
+ "Fri Feb 13 15:31:30 2009" ) ;
1599
+ assert_eq ! ( local. strftime( "%D" ) . unwrap( ) . to_string( ) , "02/13/09" ) ;
1600
+ assert_eq ! ( local. strftime( "%d" ) . unwrap( ) . to_string( ) , "13" ) ;
1601
+ assert_eq ! ( local. strftime( "%e" ) . unwrap( ) . to_string( ) , "13" ) ;
1602
+ assert_eq ! ( local. strftime( "%F" ) . unwrap( ) . to_string( ) , "2009-02-13" ) ;
1603
+ assert_eq ! ( local. strftime( "%f" ) . unwrap( ) . to_string( ) , "000054321" ) ;
1604
+ assert_eq ! ( local. strftime( "%G" ) . unwrap( ) . to_string( ) , "2009" ) ;
1605
+ assert_eq ! ( local. strftime( "%g" ) . unwrap( ) . to_string( ) , "09" ) ;
1606
+ assert_eq ! ( local. strftime( "%H" ) . unwrap( ) . to_string( ) , "15" ) ;
1607
+ assert_eq ! ( local. strftime( "%h" ) . unwrap( ) . to_string( ) , "Feb" ) ;
1608
+ assert_eq ! ( local. strftime( "%I" ) . unwrap( ) . to_string( ) , "03" ) ;
1609
+ assert_eq ! ( local. strftime( "%j" ) . unwrap( ) . to_string( ) , "044" ) ;
1610
+ assert_eq ! ( local. strftime( "%k" ) . unwrap( ) . to_string( ) , "15" ) ;
1611
+ assert_eq ! ( local. strftime( "%l" ) . unwrap( ) . to_string( ) , " 3" ) ;
1612
+ assert_eq ! ( local. strftime( "%M" ) . unwrap( ) . to_string( ) , "31" ) ;
1613
+ assert_eq ! ( local. strftime( "%m" ) . unwrap( ) . to_string( ) , "02" ) ;
1614
+ assert_eq ! ( local. strftime( "%n" ) . unwrap( ) . to_string( ) , "\n " ) ;
1615
+ assert_eq ! ( local. strftime( "%P" ) . unwrap( ) . to_string( ) , "pm" ) ;
1616
+ assert_eq ! ( local. strftime( "%p" ) . unwrap( ) . to_string( ) , "PM" ) ;
1617
+ assert_eq ! ( local. strftime( "%R" ) . unwrap( ) . to_string( ) , "15:31" ) ;
1618
+ assert_eq ! ( local. strftime( "%r" ) . unwrap( ) . to_string( ) , "03:31:30 PM" ) ;
1619
+ assert_eq ! ( local. strftime( "%S" ) . unwrap( ) . to_string( ) , "30" ) ;
1620
+ assert_eq ! ( local. strftime( "%s" ) . unwrap( ) . to_string( ) , "1234567890" ) ;
1621
+ assert_eq ! ( local. strftime( "%T" ) . unwrap( ) . to_string( ) , "15:31:30" ) ;
1622
+ assert_eq ! ( local. strftime( "%t" ) . unwrap( ) . to_string( ) , "\t " ) ;
1623
+ assert_eq ! ( local. strftime( "%U" ) . unwrap( ) . to_string( ) , "06" ) ;
1624
+ assert_eq ! ( local. strftime( "%u" ) . unwrap( ) . to_string( ) , "5" ) ;
1625
+ assert_eq ! ( local. strftime( "%V" ) . unwrap( ) . to_string( ) , "07" ) ;
1626
+ assert_eq ! ( local. strftime( "%v" ) . unwrap( ) . to_string( ) , "13-Feb-2009" ) ;
1627
+ assert_eq ! ( local. strftime( "%W" ) . unwrap( ) . to_string( ) , "06" ) ;
1628
+ assert_eq ! ( local. strftime( "%w" ) . unwrap( ) . to_string( ) , "5" ) ;
1629
1629
// FIXME (#2350): support locale
1630
- assert_eq ! ( local. strftime( "%X" ) . unwrap( ) . to_string( ) , "15:31:30" . to_string ( ) ) ;
1630
+ assert_eq ! ( local. strftime( "%X" ) . unwrap( ) . to_string( ) , "15:31:30" ) ;
1631
1631
// FIXME (#2350): support locale
1632
- assert_eq ! ( local. strftime( "%x" ) . unwrap( ) . to_string( ) , "02/13/09" . to_string ( ) ) ;
1633
- assert_eq ! ( local. strftime( "%Y" ) . unwrap( ) . to_string( ) , "2009" . to_string ( ) ) ;
1634
- assert_eq ! ( local. strftime( "%y" ) . unwrap( ) . to_string( ) , "09" . to_string ( ) ) ;
1632
+ assert_eq ! ( local. strftime( "%x" ) . unwrap( ) . to_string( ) , "02/13/09" ) ;
1633
+ assert_eq ! ( local. strftime( "%Y" ) . unwrap( ) . to_string( ) , "2009" ) ;
1634
+ assert_eq ! ( local. strftime( "%y" ) . unwrap( ) . to_string( ) , "09" ) ;
1635
1635
// FIXME (#2350): support locale
1636
- assert_eq ! ( local. strftime( "%Z" ) . unwrap( ) . to_string( ) , "" . to_string ( ) ) ;
1637
- assert_eq ! ( local. strftime( "%z" ) . unwrap( ) . to_string( ) , "-0800" . to_string ( ) ) ;
1636
+ assert_eq ! ( local. strftime( "%Z" ) . unwrap( ) . to_string( ) , "" ) ;
1637
+ assert_eq ! ( local. strftime( "%z" ) . unwrap( ) . to_string( ) , "-0800" ) ;
1638
1638
assert_eq ! ( local. strftime( "%+" ) . unwrap( ) . to_string( ) ,
1639
- "2009-02-13T15:31:30-08:00" . to_string ( ) ) ;
1640
- assert_eq ! ( local. strftime( "%%" ) . unwrap( ) . to_string( ) , "%" . to_string ( ) ) ;
1639
+ "2009-02-13T15:31:30-08:00" ) ;
1640
+ assert_eq ! ( local. strftime( "%%" ) . unwrap( ) . to_string( ) , "%" ) ;
1641
1641
1642
1642
let invalid_specifiers = [ "%E" , "%J" , "%K" , "%L" , "%N" , "%O" , "%o" , "%Q" , "%q" ] ;
1643
1643
for & sp in invalid_specifiers. iter ( ) {
@@ -1646,16 +1646,16 @@ mod tests {
1646
1646
assert_eq ! ( local. strftime( "%" ) . unwrap_err( ) , MissingFormatConverter ) ;
1647
1647
assert_eq ! ( local. strftime( "%A %" ) . unwrap_err( ) , MissingFormatConverter ) ;
1648
1648
1649
- assert_eq ! ( local. asctime( ) . to_string( ) , "Fri Feb 13 15:31:30 2009" . to_string ( ) ) ;
1650
- assert_eq ! ( local. ctime( ) . to_string( ) , "Fri Feb 13 15:31:30 2009" . to_string ( ) ) ;
1651
- assert_eq ! ( local. rfc822z( ) . to_string( ) , "Fri, 13 Feb 2009 15:31:30 -0800" . to_string ( ) ) ;
1652
- assert_eq ! ( local. rfc3339( ) . to_string( ) , "2009-02-13T15:31:30-08:00" . to_string ( ) ) ;
1649
+ assert_eq ! ( local. asctime( ) . to_string( ) , "Fri Feb 13 15:31:30 2009" ) ;
1650
+ assert_eq ! ( local. ctime( ) . to_string( ) , "Fri Feb 13 15:31:30 2009" ) ;
1651
+ assert_eq ! ( local. rfc822z( ) . to_string( ) , "Fri, 13 Feb 2009 15:31:30 -0800" ) ;
1652
+ assert_eq ! ( local. rfc3339( ) . to_string( ) , "2009-02-13T15:31:30-08:00" ) ;
1653
1653
1654
- assert_eq ! ( utc. asctime( ) . to_string( ) , "Fri Feb 13 23:31:30 2009" . to_string ( ) ) ;
1655
- assert_eq ! ( utc. ctime( ) . to_string( ) , "Fri Feb 13 15:31:30 2009" . to_string ( ) ) ;
1656
- assert_eq ! ( utc. rfc822( ) . to_string( ) , "Fri, 13 Feb 2009 23:31:30 GMT" . to_string ( ) ) ;
1657
- assert_eq ! ( utc. rfc822z( ) . to_string( ) , "Fri, 13 Feb 2009 23:31:30 -0000" . to_string ( ) ) ;
1658
- assert_eq ! ( utc. rfc3339( ) . to_string( ) , "2009-02-13T23:31:30Z" . to_string ( ) ) ;
1654
+ assert_eq ! ( utc. asctime( ) . to_string( ) , "Fri Feb 13 23:31:30 2009" ) ;
1655
+ assert_eq ! ( utc. ctime( ) . to_string( ) , "Fri Feb 13 15:31:30 2009" ) ;
1656
+ assert_eq ! ( utc. rfc822( ) . to_string( ) , "Fri, 13 Feb 2009 23:31:30 GMT" ) ;
1657
+ assert_eq ! ( utc. rfc822z( ) . to_string( ) , "Fri, 13 Feb 2009 23:31:30 -0000" ) ;
1658
+ assert_eq ! ( utc. rfc3339( ) . to_string( ) , "2009-02-13T23:31:30Z" ) ;
1659
1659
}
1660
1660
1661
1661
fn test_timespec_eq_ord ( ) {
0 commit comments