@@ -149,6 +149,7 @@ fn test_format_month_name_abbr() {
149
149
check_all ( & times, "'%b'" , & [ "'Jul'" ] ) ;
150
150
check_all ( & times, "'%1b'" , & [ "'Jul'" ] ) ;
151
151
check_all ( & times, "'%6b'" , & [ "' Jul'" ] ) ;
152
+ check_all ( & times, "'%##b'" , & [ "'JUL'" ] ) ;
152
153
check_all ( & times, "'%-_#^6b'" , & [ "'JUL'" ] ) ;
153
154
check_all ( & times, "'%-0^6b'" , & [ "'JUL'" ] ) ;
154
155
check_all ( & times, "'%0_#6b'" , & [ "' JUL'" ] ) ;
@@ -252,34 +253,34 @@ fn test_format_hour_24h_space() {
252
253
#[ rustfmt:: skip]
253
254
fn test_format_hour_12h_zero ( ) {
254
255
let times = [
255
- MockTime { hour : 13 , ..Default :: default ( ) } ,
256
+ MockTime { hour : 14 , ..Default :: default ( ) } ,
256
257
MockTime { hour : 0 , ..Default :: default ( ) } ,
257
258
] ;
258
259
259
- check_all ( & times, "'%I'" , & [ "'01 '" , "'12'" ] ) ;
260
- check_all ( & times, "'%1I'" , & [ "'1 '" , "'12'" ] ) ;
261
- check_all ( & times, "'%4I'" , & [ "'0001 '" , "'0012'" ] ) ;
262
- check_all ( & times, "'%-_I'" , & [ "'1 '" , "'12'" ] ) ;
263
- check_all ( & times, "'%-0I'" , & [ "'1 '" , "'12'" ] ) ;
264
- check_all ( & times, "'%0_I'" , & [ "' 1 '" , "'12'" ] ) ;
265
- check_all ( & times, "'%_0I'" , & [ "'01 '" , "'12'" ] ) ;
260
+ check_all ( & times, "'%I'" , & [ "'02 '" , "'12'" ] ) ;
261
+ check_all ( & times, "'%1I'" , & [ "'2 '" , "'12'" ] ) ;
262
+ check_all ( & times, "'%4I'" , & [ "'0002 '" , "'0012'" ] ) ;
263
+ check_all ( & times, "'%-_I'" , & [ "'2 '" , "'12'" ] ) ;
264
+ check_all ( & times, "'%-0I'" , & [ "'2 '" , "'12'" ] ) ;
265
+ check_all ( & times, "'%0_I'" , & [ "' 2 '" , "'12'" ] ) ;
266
+ check_all ( & times, "'%_0I'" , & [ "'02 '" , "'12'" ] ) ;
266
267
}
267
268
268
269
#[ test]
269
270
#[ rustfmt:: skip]
270
271
fn test_format_hour_12h_space ( ) {
271
272
let times = [
272
- MockTime { hour : 13 , ..Default :: default ( ) } ,
273
+ MockTime { hour : 14 , ..Default :: default ( ) } ,
273
274
MockTime { hour : 0 , ..Default :: default ( ) } ,
274
275
] ;
275
276
276
- check_all ( & times, "'%l'" , & [ "' 1 '" , "'12'" ] ) ;
277
- check_all ( & times, "'%1l'" , & [ "'1 '" , "'12'" ] ) ;
278
- check_all ( & times, "'%4l'" , & [ "' 1 '" , "' 12'" ] ) ;
279
- check_all ( & times, "'%-_l'" , & [ "'1 '" , "'12'" ] ) ;
280
- check_all ( & times, "'%-0l'" , & [ "'1 '" , "'12'" ] ) ;
281
- check_all ( & times, "'%0_l'" , & [ "' 1 '" , "'12'" ] ) ;
282
- check_all ( & times, "'%_0l'" , & [ "'01 '" , "'12'" ] ) ;
277
+ check_all ( & times, "'%l'" , & [ "' 2 '" , "'12'" ] ) ;
278
+ check_all ( & times, "'%1l'" , & [ "'2 '" , "'12'" ] ) ;
279
+ check_all ( & times, "'%4l'" , & [ "' 2 '" , "' 12'" ] ) ;
280
+ check_all ( & times, "'%-_l'" , & [ "'2 '" , "'12'" ] ) ;
281
+ check_all ( & times, "'%-0l'" , & [ "'2 '" , "'12'" ] ) ;
282
+ check_all ( & times, "'%0_l'" , & [ "' 2 '" , "'12'" ] ) ;
283
+ check_all ( & times, "'%_0l'" , & [ "'02 '" , "'12'" ] ) ;
283
284
}
284
285
285
286
#[ test]
@@ -709,17 +710,17 @@ fn test_format_percent() {
709
710
#[ rustfmt:: skip]
710
711
fn test_format_combination_date_time ( ) {
711
712
let times = [
712
- MockTime :: new ( 1970 , 1 , 1 , 0 , 0 , 0 , 0 , 4 , 1 , 0 , false , 0 , "" ) ,
713
- MockTime :: new ( -1970 , 1 , 1 , 0 , 0 , 0 , 0 , 4 , 1 , 0 , false , 0 , "" ) ,
713
+ MockTime :: new ( 971 , 1 , 1 , 0 , 0 , 0 , 0 , 4 , 1 , 0 , false , 0 , "" ) ,
714
+ MockTime :: new ( -971 , 1 , 1 , 0 , 0 , 0 , 0 , 4 , 1 , 0 , false , 0 , "" ) ,
714
715
] ;
715
716
716
- check_all ( & times, "'%c'" , & [ "'Thu Jan 1 00:00:00 1970 '" , "'Thu Jan 1 00:00:00 -1970 '" ] ) ;
717
- check_all ( & times, "'%1c'" , & [ "'Thu Jan 1 00:00:00 1970 '" , "'Thu Jan 1 00:00:00 -1970 '" ] ) ;
718
- check_all ( & times, "'%30c'" , & [ "' Thu Jan 1 00:00:00 1970 '" , "' Thu Jan 1 00:00:00 -1970 '" ] ) ;
719
- check_all ( & times, "'%-^_#30c'" , & [ "' THU JAN 1 00:00:00 1970 '" , "' THU JAN 1 00:00:00 -1970 '" ] ) ;
720
- check_all ( & times, "'%-0^30c'" , & [ "'000000THU JAN 1 00:00:00 1970 '" , "'00000THU JAN 1 00:00:00 -1970 '" ] ) ;
721
- check_all ( & times, "'%0_#30c'" , & [ "' Thu Jan 1 00:00:00 1970 '" , "' Thu Jan 1 00:00:00 -1970 '" ] ) ;
722
- check_all ( & times, "'%_030c'" , & [ "'000000Thu Jan 1 00:00:00 1970 '" , "'00000Thu Jan 1 00:00:00 -1970 '" ] ) ;
717
+ check_all ( & times, "'%c'" , & [ "'Thu Jan 1 00:00:00 0971 '" , "'Thu Jan 1 00:00:00 -0971 '" ] ) ;
718
+ check_all ( & times, "'%1c'" , & [ "'Thu Jan 1 00:00:00 0971 '" , "'Thu Jan 1 00:00:00 -0971 '" ] ) ;
719
+ check_all ( & times, "'%30c'" , & [ "' Thu Jan 1 00:00:00 0971 '" , "' Thu Jan 1 00:00:00 -0971 '" ] ) ;
720
+ check_all ( & times, "'%-^_#30c'" , & [ "' THU JAN 1 00:00:00 0971 '" , "' THU JAN 1 00:00:00 -0971 '" ] ) ;
721
+ check_all ( & times, "'%-0^30c'" , & [ "'000000THU JAN 1 00:00:00 0971 '" , "'00000THU JAN 1 00:00:00 -0971 '" ] ) ;
722
+ check_all ( & times, "'%0_#30c'" , & [ "' Thu Jan 1 00:00:00 0971 '" , "' Thu Jan 1 00:00:00 -0971 '" ] ) ;
723
+ check_all ( & times, "'%_030c'" , & [ "'000000Thu Jan 1 00:00:00 0971 '" , "'00000Thu Jan 1 00:00:00 -0971 '" ] ) ;
723
724
}
724
725
725
726
#[ test]
@@ -751,17 +752,17 @@ fn test_format_combination_date() {
751
752
#[ rustfmt:: skip]
752
753
fn test_format_combination_iso_8601 ( ) {
753
754
let times = [
754
- MockTime { year : 1234 , month : 5 , day : 6 , ..Default :: default ( ) } ,
755
- MockTime { year : -1234 , month : 5 , day : 6 , ..Default :: default ( ) } ,
755
+ MockTime { year : 234 , month : 5 , day : 6 , ..Default :: default ( ) } ,
756
+ MockTime { year : -234 , month : 5 , day : 6 , ..Default :: default ( ) } ,
756
757
] ;
757
758
758
- check_all ( & times, "'%F'" , & [ "'1234 -05-06'" , "'-1234 -05-06'" ] ) ;
759
- check_all ( & times, "'%1F'" , & [ "'1234 -05-06'" , "'-1234 -05-06'" ] ) ;
760
- check_all ( & times, "'%12F'" , & [ "' 1234 -05-06'" , "' -1234 -05-06'" ] ) ;
761
- check_all ( & times, "'%-^_#12F'" , & [ "' 1234 -05-06'" , "' -1234 -05-06'" ] ) ;
762
- check_all ( & times, "'%-0^12F'" , & [ "'001234 -05-06'" , "'0-1234 -05-06'" ] ) ;
763
- check_all ( & times, "'%0_#12F'" , & [ "' 1234 -05-06'" , "' -1234 -05-06'" ] ) ;
764
- check_all ( & times, "'%_012F'" , & [ "'001234 -05-06'" , "'0-1234 -05-06'" ] ) ;
759
+ check_all ( & times, "'%F'" , & [ "'0234 -05-06'" , "'-0234 -05-06'" ] ) ;
760
+ check_all ( & times, "'%1F'" , & [ "'0234 -05-06'" , "'-0234 -05-06'" ] ) ;
761
+ check_all ( & times, "'%12F'" , & [ "' 0234 -05-06'" , "' -0234 -05-06'" ] ) ;
762
+ check_all ( & times, "'%-^_#12F'" , & [ "' 0234 -05-06'" , "' -0234 -05-06'" ] ) ;
763
+ check_all ( & times, "'%-0^12F'" , & [ "'000234 -05-06'" , "'0-0234 -05-06'" ] ) ;
764
+ check_all ( & times, "'%0_#12F'" , & [ "' 0234 -05-06'" , "' -0234 -05-06'" ] ) ;
765
+ check_all ( & times, "'%_012F'" , & [ "'000234 -05-06'" , "'0-0234 -05-06'" ] ) ;
765
766
}
766
767
767
768
#[ test]
0 commit comments