1 // Copyright (c) 2007-2013 International Business Machines
2 // Corporation and others. All Rights Reserved.
3 format:table(nofallback) {
5 Description { "These are the data driven format tests" }
6 LongDescription { "Data for data driven format tests." }
11 Description { "Test data for format and parse :" }
14 // options: 'format', or 'parse'. One can be omitted if this is a 1 way test.
16 Type { "date_format" }
22 Headers { "locale", "zone", "spec", "date", "str"}
23 // locale: locale including calendar type
24 // zone: time zone name, or "" to not explicitly set zone
25 // spec: either 'PATTERN=y mm h' etc, or 'DATE=SHORT,TIME=LONG'
26 // date: either 'MILLIS=####' where #### is millis,
27 // or a calendar spec ERA=0,YEAR=1, etc.. applied to the calendar type specified by the locale
28 // or RELATIVE_MILLIS=### where ### is a signed value which is added to the current millis
29 // or RELATIVE_ADD:DATE=1 which means that the field "DATE" will be added by +1 relative to current time,
30 // and any other fields present will be set explicitly.
31 // str: the expected unicode string
34 "en_US@calendar=gregorian",
36 "DATE=SHORT,TIME=SHORT",
37 "ERA=1,YEAR=2007,MONTH=AUGUST,DATE=8,HOUR_OF_DAY=18,MINUTE=54,SECOND=0",
44 "ERA=1,YEAR=98,MONTH=0,DATE=24",
48 //民國前2年1月24日 -> 1910-1-24
52 "ERA=0,YEAR=2,MONTH=0,DATE=24",
59 Description { "relative format :" }
63 Type { "date_format" }
66 Headers { "locale", "zone", "spec", "date", "str"}
69 "en_US@calendar=gregorian",
71 "DATE=RELATIVE_SHORT",
72 "RELATIVE_ADD:DATE=1", // one day from now
76 "en_US@calendar=gregorian",
78 "DATE=RELATIVE_SHORT",
79 "RELATIVE_MILLIS=0", // today
83 "en_US@calendar=gregorian",
85 "DATE=RELATIVE_SHORT",
86 "RELATIVE_ADD:DATE=-1", // one day before now
89 // date only, out of relative range
91 "en_US@calendar=gregorian",
94 "ERA=1,YEAR=2012,MONTH=OCTOBER,DATE=8,HOUR_OF_DAY=23,MINUTE=59,SECOND=0",
95 "Monday, October 8, 2012"
99 "en_US@calendar=gregorian",
102 "ERA=1,YEAR=2012,MONTH=OCTOBER,DATE=8,HOUR_OF_DAY=23,MINUTE=59,SECOND=0",
106 "en_US@calendar=gregorian",
109 "RELATIVE_ADD:DATE=-1,HOUR_OF_DAY=17,MINUTE=0,SECOND=0", // one day before now at specified time
112 // normal formats, combined using 'at'
114 "en_US@calendar=gregorian",
116 "DATE=RELATIVE_FULL,TIME=LONG",
117 "ERA=1,YEAR=2012,MONTH=OCTOBER,DATE=8,HOUR_OF_DAY=23,MINUTE=59,SECOND=0",
118 "Monday, October 8, 2012 at 11:59:00 PM GMT"
120 // normal formats, combined using ", "
122 "en_US@calendar=gregorian",
124 "DATE=RELATIVE_MEDIUM,TIME=SHORT",
125 "ERA=1,YEAR=2012,MONTH=OCTOBER,DATE=8,HOUR_OF_DAY=23,MINUTE=59,SECOND=0",
126 "Oct 8, 2012, 11:59 PM"
128 // formats with relative day, combined using 'at'
130 "en_US@calendar=gregorian",
132 "DATE=RELATIVE_FULL,TIME=LONG",
133 "RELATIVE_ADD:DATE=-1,HOUR_OF_DAY=17,MINUTE=0,SECOND=0", // one day before now at specified time
134 "Yesterday at 5:00:00 PM GMT"
136 // formats with relative day, combined using ", "
138 "en_US@calendar=gregorian",
140 "DATE=RELATIVE_MEDIUM,TIME=SHORT",
141 "RELATIVE_ADD:DATE=-1,HOUR_OF_DAY=17,MINUTE=0,SECOND=0", // one day before now at specified time
144 // normal formats that have quoted literals, combined
146 "pt@calendar=gregorian",
148 "DATE=RELATIVE_FULL,TIME=LONG",
149 "ERA=1,YEAR=2012,MONTH=OCTOBER,DATE=8,HOUR_OF_DAY=23,MINUTE=59,SECOND=0",
150 "segunda-feira, 8 de outubro de 2012 23:59:00 Horário de Greenwich"
152 // vi combined formats have time first
154 "vi@calendar=gregorian",
156 "DATE=RELATIVE_LONG,TIME=MEDIUM",
157 "ERA=1,YEAR=2012,MONTH=OCTOBER,DATE=8,HOUR_OF_DAY=23,MINUTE=59,SECOND=0",
158 "23:59:00 Ngày 08 tháng 10 năm 2012"
161 "vi@calendar=gregorian",
163 "DATE=RELATIVE_LONG,TIME=MEDIUM",
164 "RELATIVE_ADD:DATE=-1,HOUR_OF_DAY=17,MINUTE=0,SECOND=0", // one day before now at specified time
165 "17:00:00 Ngày hôm qua"
167 // el combines formats using hyphen
169 "el@calendar=gregorian",
171 "DATE=RELATIVE_LONG,TIME=MEDIUM",
172 "ERA=1,YEAR=2012,MONTH=OCTOBER,DATE=8,HOUR_OF_DAY=23,MINUTE=59,SECOND=0",
173 "8 Οκτωβρίου 2012 - 11:59:00 μ.μ."
176 "el@calendar=gregorian",
178 "DATE=RELATIVE_LONG,TIME=MEDIUM",
179 "RELATIVE_ADD:DATE=-1,HOUR_OF_DAY=17,MINUTE=0,SECOND=0", // one day before now at specified time
180 "Χτες - 5:00:00 μ.μ."
184 "mt_MT@calendar=gregorian",
186 "DATE=RELATIVE_SHORT",
187 "RELATIVE_ADD:DATE=1", // one day from now
191 "mt_MT@calendar=gregorian",
193 "DATE=RELATIVE_SHORT",
194 "RELATIVE_MILLIS=0", // today
198 "mt_MT@calendar=gregorian",
200 "DATE=RELATIVE_SHORT",
201 "RELATIVE_ADD:DATE=-1", // one day before now
207 "DATE=RELATIVE_SHORT",
208 "RELATIVE_ADD:DATE=-2", // 2 days ago
215 Description { "Test data for multiple year lengths, y yy yyy yyyy yyyyy:" }
218 // options: 'format', or 'parse'. One can be omitted if this is a 1 way test.
220 Type { "date_format" }
222 // These are not round trippable, so do not parse.
224 // Type { "date_parse" }
227 Headers { "locale", "zone", "spec", "date", "str"}
228 // locale: locale including calendar type
229 // zone: time zone name, or "" to not explicitly set zone
230 // spec: either 'PATTERN=y mm h' etc, or 'DATE=SHORT,TIME=LONG'
231 // date: either 'MILLIS=####' where #### is millis,
232 // or a calendar spec ERA=0,YEAR=1, etc.. applied to the calendar type specified by the locale
233 // or RELATIVE_MILLIS=### where ### is a signed value which is added to the current millis
234 // or RELATIVE_ADD:DATE=1 which means that the field "DATE" will be added by +1 relative to current time,
235 // and any other fields present will be set explicitly.
236 // str: the expected unicode string
239 //Year y yy yyy yyyy yyyyy
242 //AD 1 1 01 001 0001 00001
244 "en_US@calendar=gregorian",
251 "en_US@calendar=gregorian",
258 "en_US@calendar=gregorian",
265 "en_US@calendar=gregorian",
272 "en_US@calendar=gregorian",
278 //AD 12 12 12 012 0012 00012
280 "en_US@calendar=gregorian",
287 "en_US@calendar=gregorian",
294 "en_US@calendar=gregorian",
301 "en_US@calendar=gregorian",
308 "en_US@calendar=gregorian",
314 //AD 123 123 23 123 0123 00123
316 "en_US@calendar=gregorian",
323 "en_US@calendar=gregorian",
330 "en_US@calendar=gregorian",
337 "en_US@calendar=gregorian",
344 "en_US@calendar=gregorian",
350 //AD 1234 1234 34 1234 1234 01234
352 "en_US@calendar=gregorian",
359 "en_US@calendar=gregorian",
366 "en_US@calendar=gregorian",
373 "en_US@calendar=gregorian",
380 "en_US@calendar=gregorian",
386 //AD 12345 12345 45 12345 12345 12345
388 "en_US@calendar=gregorian",
395 "en_US@calendar=gregorian",
402 "en_US@calendar=gregorian",
409 "en_US@calendar=gregorian",
416 "en_US@calendar=gregorian",
424 TestConsistentPivot {
426 Description { "Test consistent pivot (parse/format) for multiple year lengths, y yy yyy yyyy yyyyy:" }
429 // options: 'format', or 'parse'. One can be omitted if this is a 1 way test.
431 Type { "date_format" }
434 Type { "date_parse" }
437 Headers { "locale", "zone", "spec", "date", "str"}
438 // locale: locale including calendar type
439 // zone: time zone name, or "" to not explicitly set zone
440 // spec: either 'PATTERN=y mm h' etc, or 'DATE=SHORT,TIME=LONG'
441 // date: either 'MILLIS=####' where #### is millis,
442 // or a calendar spec ERA=0,YEAR=1, etc.. applied to the calendar type specified by the locale
443 // or RELATIVE_MILLIS=### where ### is a signed value which is added to the current millis
444 // or RELATIVE_ADD:DATE=1 which means that the field "DATE" will be added by +1 relative to current time,
445 // and any other fields present will be set explicitly.
446 // str: the expected unicode string
449 //Year y yy yyy yyyy yyyyy
452 //AD 1 1 01 001 0001 00001
454 "en_US@calendar=gregorian",
461 "en_US@calendar=gregorian",
468 "en_US@calendar=gregorian",
475 "en_US@calendar=gregorian",
482 "en_US@calendar=gregorian",
491 "en_US@calendar=japanese",
498 "en_US@calendar=japanese",
505 "en_US@calendar=japanese",
512 "en_US@calendar=japanese",
519 "en_US@calendar=japanese",
530 Description { "Test Hebrew calendar:" }
533 // options: 'format', or 'parse'. One can be omitted if this is a 1 way test.
535 Type { "date_format" }
538 Headers { "locale", "zone", "spec", "date", "str"}
539 // locale: locale including calendar type
540 // zone: time zone name, or "" to not explicitly set zone
541 // spec: either 'PATTERN=y mm h' etc, or 'DATE=SHORT,TIME=LONG'
542 // date: either 'MILLIS=####' where #### is millis,
543 // or a calendar spec ERA=0,YEAR=1, etc.. applied to the calendar type specified by the locale
544 // or RELATIVE_MILLIS=### where ### is a signed value which is added to the current millis
545 // or RELATIVE_ADD:DATE=1 which means that the field "DATE" will be added by +1 relative to current time,
546 // and any other fields present will be set explicitly.
547 // str: the expected unicode string
551 "en_US@calendar=hebrew",
553 "DATE=FULL,TIME=FULL",
554 "MILLIS=3076424179200000",
555 "Friday, Heshvan 3, 103217 AM at 12:00:00 AM GMT-08:00"
561 Description { "Additional date parse tests (may not
562 round/trip to format.)" }
565 // options: 'format', or 'parse'. One can be omitted if this is a 1 way test.
567 Type { "date_parse" }
570 Headers { "locale", "zone", "spec", "date", "str"}
571 // locale: locale including calendar type
572 // zone: time zone name, or "" to not explicitly set zone
573 // spec: either 'PATTERN=y mm h' etc, or 'DATE=SHORT,TIME=LONG'
574 // date: either 'MILLIS=####' where #### is millis,
575 // or a calendar spec ERA=0,YEAR=1, etc.. applied to the calendar type specified by the locale
576 // or RELATIVE_MILLIS=### where ### is a signed value which is added to the current millis
577 // or RELATIVE_ADD:DATE=1 which means that the field "DATE" will be added by +1 relative to current time,
578 // and any other fields present will be set explicitly.
579 // str: the expected unicode string
583 "en_US@calendar=gregorian",
585 "PATTERN=YYYYHHmmssEEEww",
586 "YEAR=1999,HOUR_OF_DAY=4,MINUTE=5,SECOND=6,DAY_OF_WEEK=2,WEEK_OF_YEAR=4",