2009-04-10 07:47:09 +00:00
|
|
|
// Copyright (c) 2007-2009 International Business Machines
|
2007-08-10 02:09:24 +00:00
|
|
|
// Corporation and others. All Rights Reserved.
|
|
|
|
format:table(nofallback) {
|
|
|
|
Info {
|
|
|
|
Description { "These are the data driven format tests" }
|
|
|
|
LongDescription { "Data for data driven format tests." }
|
|
|
|
}
|
|
|
|
TestData {
|
|
|
|
TestDateFormatBasic {
|
|
|
|
Info {
|
|
|
|
Description { "Test data for format and parse :" }
|
|
|
|
}
|
|
|
|
Settings {
|
|
|
|
// options: 'format', or 'parse'. One can be omitted if this is a 1 way test.
|
|
|
|
{
|
|
|
|
Type { "date_format" }
|
|
|
|
},
|
|
|
|
{
|
|
|
|
Type { "date_parse" }
|
|
|
|
},
|
|
|
|
}
|
|
|
|
Headers { "locale","spec", "date", "str"}
|
|
|
|
// locale: locale including calendar type
|
|
|
|
// spec: either 'PATTERN=y mm h' etc, or 'DATE=SHORT,TIME=LONG'
|
2008-01-04 01:21:37 +00:00
|
|
|
// date: either 'MILLIS=####' where #### is millis,
|
|
|
|
// or a calendar spec ERA=0,YEAR=1, etc.. applied to the calendar type specified by the locale
|
|
|
|
// or RELATIVE_MILLIS=### where ### is a signed value which is added to the current millis
|
|
|
|
// or RELATIVE_ADD:DATE=1 which means that the field "DATE" will be added by +1 relative to current time
|
2007-08-10 02:09:24 +00:00
|
|
|
// str: the expected unicode string
|
|
|
|
Cases {
|
|
|
|
{
|
|
|
|
"en_US@calendar=gregorian",
|
|
|
|
"DATE=SHORT,TIME=SHORT",
|
|
|
|
"ERA=1,YEAR=2007,MONTH=AUGUST,DATE=8,HOUR_OF_DAY=18,MINUTE=54,SECOND=0",
|
|
|
|
"8/8/07 6:54 PM"
|
|
|
|
},
|
2007-08-13 23:48:00 +00:00
|
|
|
{
|
2008-05-16 15:01:02 +00:00
|
|
|
"zh_TW@calendar=roc",
|
2007-08-13 23:48:00 +00:00
|
|
|
"DATE=LONG",
|
2007-08-16 18:40:18 +00:00
|
|
|
"ERA=1,YEAR=98,MONTH=0,DATE=24",
|
2007-08-13 23:48:00 +00:00
|
|
|
"民國98年1月24日",
|
|
|
|
},
|
2007-08-16 18:40:18 +00:00
|
|
|
{
|
|
|
|
//民國前2年1月24日 -> 1910-1-24
|
2008-05-16 15:01:02 +00:00
|
|
|
"zh_TW@calendar=roc",
|
2007-08-16 18:40:18 +00:00
|
|
|
"DATE=LONG",
|
|
|
|
"ERA=0,YEAR=2,MONTH=0,DATE=24",
|
|
|
|
"民國前2年1月24日",
|
|
|
|
},
|
2007-08-10 02:09:24 +00:00
|
|
|
}
|
|
|
|
}
|
2007-08-23 20:14:07 +00:00
|
|
|
TestFormatRelative {
|
|
|
|
Info {
|
|
|
|
Description { "relative format :" }
|
|
|
|
}
|
|
|
|
Settings {
|
|
|
|
{
|
|
|
|
Type { "date_format" }
|
|
|
|
},
|
|
|
|
}
|
|
|
|
Headers { "locale","spec", "date", "str"}
|
|
|
|
Cases {
|
|
|
|
{
|
|
|
|
"en_US@calendar=gregorian",
|
|
|
|
"DATE=RELATIVE_SHORT",
|
2008-01-04 01:21:37 +00:00
|
|
|
"RELATIVE_ADD:DATE=1", // one day from now
|
2007-08-23 20:14:07 +00:00
|
|
|
"Tomorrow"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"en_US@calendar=gregorian",
|
|
|
|
"DATE=RELATIVE_SHORT",
|
2008-01-04 01:21:37 +00:00
|
|
|
"RELATIVE_MILLIS=0", // today
|
2007-08-23 20:14:07 +00:00
|
|
|
"Today"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"en_US@calendar=gregorian",
|
|
|
|
"DATE=RELATIVE_SHORT",
|
2008-01-04 01:21:37 +00:00
|
|
|
"RELATIVE_ADD:DATE=-1", // one day before now
|
2007-08-23 20:14:07 +00:00
|
|
|
"Yesterday"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"mt_MT@calendar=gregorian",
|
|
|
|
"DATE=RELATIVE_SHORT",
|
2008-01-04 01:21:37 +00:00
|
|
|
"RELATIVE_ADD:DATE=1", // one day from now
|
2007-08-23 20:14:07 +00:00
|
|
|
"Għada"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"mt_MT@calendar=gregorian",
|
|
|
|
"DATE=RELATIVE_SHORT",
|
2008-01-04 01:21:37 +00:00
|
|
|
"RELATIVE_MILLIS=0", // today
|
2007-08-23 20:14:07 +00:00
|
|
|
"Illum"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"mt_MT@calendar=gregorian",
|
|
|
|
"DATE=RELATIVE_SHORT",
|
2008-01-04 01:21:37 +00:00
|
|
|
"RELATIVE_ADD:DATE=-1", // one day before now
|
2007-08-23 20:14:07 +00:00
|
|
|
"Lbieraħ"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"ru",
|
|
|
|
"DATE=RELATIVE_SHORT",
|
2008-01-04 01:21:37 +00:00
|
|
|
"RELATIVE_ADD:DATE=-2", // 2 days ago
|
2007-08-23 20:14:07 +00:00
|
|
|
"Позавчера"
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|
2008-04-25 01:13:33 +00:00
|
|
|
TestYearLengths {
|
|
|
|
Info {
|
|
|
|
Description { "Test data for multiple year lengths, y yy yyy yyyy yyyyy:" }
|
|
|
|
}
|
|
|
|
Settings {
|
|
|
|
// options: 'format', or 'parse'. One can be omitted if this is a 1 way test.
|
|
|
|
{
|
|
|
|
Type { "date_format" }
|
|
|
|
},
|
|
|
|
// These are not round trippable, so do not parse.
|
|
|
|
// {
|
|
|
|
// Type { "date_parse" }
|
|
|
|
// },
|
|
|
|
}
|
|
|
|
Headers { "locale","spec", "date", "str"}
|
|
|
|
// locale: locale including calendar type
|
|
|
|
// spec: either 'PATTERN=y mm h' etc, or 'DATE=SHORT,TIME=LONG'
|
|
|
|
// date: either 'MILLIS=####' where #### is millis,
|
|
|
|
// or a calendar spec ERA=0,YEAR=1, etc.. applied to the calendar type specified by the locale
|
|
|
|
// or RELATIVE_MILLIS=### where ### is a signed value which is added to the current millis
|
|
|
|
// or RELATIVE_ADD:DATE=1 which means that the field "DATE" will be added by +1 relative to current time
|
|
|
|
// str: the expected unicode string
|
|
|
|
|
|
|
|
// from CLDR UTS 35:
|
|
|
|
//Year y yy yyy yyyy yyyyy
|
|
|
|
|
|
|
|
Cases {
|
|
|
|
//AD 1 1 01 001 0001 00001
|
|
|
|
{
|
|
|
|
"en_US@calendar=gregorian",
|
|
|
|
"PATTERN=G y",
|
|
|
|
"YEAR=1",
|
|
|
|
"AD 1"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"en_US@calendar=gregorian",
|
|
|
|
"PATTERN=G yy",
|
|
|
|
"YEAR=1",
|
|
|
|
"AD 01"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"en_US@calendar=gregorian",
|
|
|
|
"PATTERN=G yyy",
|
|
|
|
"YEAR=1",
|
|
|
|
"AD 001"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"en_US@calendar=gregorian",
|
|
|
|
"PATTERN=G yyyy",
|
|
|
|
"YEAR=1",
|
|
|
|
"AD 0001"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"en_US@calendar=gregorian",
|
|
|
|
"PATTERN=G yyyyy",
|
|
|
|
"YEAR=1",
|
|
|
|
"AD 00001"
|
|
|
|
},
|
|
|
|
//AD 12 12 12 012 0012 00012
|
|
|
|
{
|
|
|
|
"en_US@calendar=gregorian",
|
|
|
|
"PATTERN=G y",
|
|
|
|
"YEAR=12",
|
|
|
|
"AD 12"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"en_US@calendar=gregorian",
|
|
|
|
"PATTERN=G yy",
|
|
|
|
"YEAR=12",
|
|
|
|
"AD 12"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"en_US@calendar=gregorian",
|
|
|
|
"PATTERN=G yyy",
|
|
|
|
"YEAR=12",
|
|
|
|
"AD 012"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"en_US@calendar=gregorian",
|
|
|
|
"PATTERN=G yyyy",
|
|
|
|
"YEAR=12",
|
|
|
|
"AD 0012"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"en_US@calendar=gregorian",
|
|
|
|
"PATTERN=G yyyyy",
|
|
|
|
"YEAR=12",
|
|
|
|
"AD 00012"
|
|
|
|
},
|
|
|
|
//AD 123 123 23 123 0123 00123
|
|
|
|
{
|
|
|
|
"en_US@calendar=gregorian",
|
|
|
|
"PATTERN=G y",
|
|
|
|
"YEAR=123",
|
|
|
|
"AD 123"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"en_US@calendar=gregorian",
|
|
|
|
"PATTERN=G yy",
|
|
|
|
"YEAR=123",
|
|
|
|
"AD 23"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"en_US@calendar=gregorian",
|
|
|
|
"PATTERN=G yyy",
|
|
|
|
"YEAR=123",
|
|
|
|
"AD 123"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"en_US@calendar=gregorian",
|
|
|
|
"PATTERN=G yyyy",
|
|
|
|
"YEAR=123",
|
|
|
|
"AD 0123"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"en_US@calendar=gregorian",
|
|
|
|
"PATTERN=G yyyyy",
|
|
|
|
"YEAR=123",
|
|
|
|
"AD 00123"
|
|
|
|
},
|
|
|
|
//AD 1234 1234 34 1234 1234 01234
|
|
|
|
{
|
|
|
|
"en_US@calendar=gregorian",
|
|
|
|
"PATTERN=G y",
|
|
|
|
"YEAR=1234",
|
|
|
|
"AD 1234"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"en_US@calendar=gregorian",
|
|
|
|
"PATTERN=G yy",
|
|
|
|
"YEAR=1234",
|
|
|
|
"AD 34"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"en_US@calendar=gregorian",
|
|
|
|
"PATTERN=G yyy",
|
|
|
|
"YEAR=1234",
|
|
|
|
"AD 1234"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"en_US@calendar=gregorian",
|
|
|
|
"PATTERN=G yyyy",
|
|
|
|
"YEAR=1234",
|
|
|
|
"AD 1234"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"en_US@calendar=gregorian",
|
|
|
|
"PATTERN=G yyyyy",
|
|
|
|
"YEAR=1234",
|
|
|
|
"AD 01234"
|
|
|
|
},
|
|
|
|
//AD 12345 12345 45 12345 12345 12345
|
|
|
|
{
|
|
|
|
"en_US@calendar=gregorian",
|
|
|
|
"PATTERN=G y",
|
|
|
|
"YEAR=12345",
|
|
|
|
"AD 12345"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"en_US@calendar=gregorian",
|
|
|
|
"PATTERN=G yy",
|
|
|
|
"YEAR=12345",
|
|
|
|
"AD 45"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"en_US@calendar=gregorian",
|
|
|
|
"PATTERN=G yyy",
|
|
|
|
"YEAR=12345",
|
|
|
|
"AD 12345"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"en_US@calendar=gregorian",
|
|
|
|
"PATTERN=G yyyy",
|
|
|
|
"YEAR=12345",
|
|
|
|
"AD 12345"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"en_US@calendar=gregorian",
|
|
|
|
"PATTERN=G yyyyy",
|
|
|
|
"YEAR=12345",
|
|
|
|
"AD 12345"
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|
2008-04-25 04:00:51 +00:00
|
|
|
TestConsistentPivot {
|
|
|
|
Info {
|
|
|
|
Description { "Test consistent pivot (parse/format) for multiple year lengths, y yy yyy yyyy yyyyy:" }
|
|
|
|
}
|
|
|
|
Settings {
|
|
|
|
// options: 'format', or 'parse'. One can be omitted if this is a 1 way test.
|
|
|
|
{
|
|
|
|
Type { "date_format" }
|
|
|
|
},
|
|
|
|
{
|
|
|
|
Type { "date_parse" }
|
|
|
|
},
|
|
|
|
}
|
|
|
|
Headers { "locale","spec", "date", "str"}
|
|
|
|
// locale: locale including calendar type
|
|
|
|
// spec: either 'PATTERN=y mm h' etc, or 'DATE=SHORT,TIME=LONG'
|
|
|
|
// date: either 'MILLIS=####' where #### is millis,
|
|
|
|
// or a calendar spec ERA=0,YEAR=1, etc.. applied to the calendar type specified by the locale
|
|
|
|
// or RELATIVE_MILLIS=### where ### is a signed value which is added to the current millis
|
|
|
|
// or RELATIVE_ADD:DATE=1 which means that the field "DATE" will be added by +1 relative to current time
|
|
|
|
// str: the expected unicode string
|
|
|
|
|
|
|
|
// from CLDR UTS 35:
|
|
|
|
//Year y yy yyy yyyy yyyyy
|
|
|
|
|
|
|
|
Cases {
|
|
|
|
//AD 1 1 01 001 0001 00001
|
|
|
|
{
|
|
|
|
"en_US@calendar=gregorian",
|
|
|
|
"PATTERN=G y",
|
|
|
|
"YEAR=2008",
|
|
|
|
"AD 2008"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"en_US@calendar=gregorian",
|
|
|
|
"PATTERN=G yy",
|
|
|
|
"YEAR=2008",
|
|
|
|
"AD 08"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"en_US@calendar=gregorian",
|
|
|
|
"PATTERN=G yyy",
|
|
|
|
"YEAR=2008",
|
|
|
|
"AD 2008"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"en_US@calendar=gregorian",
|
|
|
|
"PATTERN=G yyyy",
|
|
|
|
"YEAR=2008",
|
|
|
|
"AD 2008"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"en_US@calendar=gregorian",
|
|
|
|
"PATTERN=G yyyyy",
|
|
|
|
"YEAR=2008",
|
|
|
|
"AD 02008"
|
|
|
|
},
|
|
|
|
|
|
|
|
// Japanese
|
|
|
|
{
|
|
|
|
"en_US@calendar=japanese",
|
|
|
|
"PATTERN=G y",
|
|
|
|
"YEAR=8",
|
|
|
|
"Heisei 8"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"en_US@calendar=japanese",
|
|
|
|
"PATTERN=G yy",
|
|
|
|
"YEAR=8",
|
|
|
|
"Heisei 08"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"en_US@calendar=japanese",
|
|
|
|
"PATTERN=G yyy",
|
|
|
|
"YEAR=8",
|
|
|
|
"Heisei 008"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"en_US@calendar=japanese",
|
|
|
|
"PATTERN=G yyyy",
|
|
|
|
"YEAR=8",
|
|
|
|
"Heisei 0008"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"en_US@calendar=japanese",
|
|
|
|
"PATTERN=G yyyyy",
|
|
|
|
"YEAR=8",
|
|
|
|
"Heisei 00008"
|
|
|
|
},
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
2008-07-02 21:33:33 +00:00
|
|
|
TestHebrew{
|
|
|
|
Info {
|
|
|
|
Description { "Test Hebrew calendar:" }
|
|
|
|
}
|
|
|
|
Settings {
|
|
|
|
// options: 'format', or 'parse'. One can be omitted if this is a 1 way test.
|
|
|
|
{
|
|
|
|
Type { "date_format" }
|
|
|
|
},
|
|
|
|
}
|
|
|
|
Headers { "locale","spec", "date", "str"}
|
|
|
|
// locale: locale including calendar type
|
|
|
|
// spec: either 'PATTERN=y mm h' etc, or 'DATE=SHORT,TIME=LONG'
|
|
|
|
// date: either 'MILLIS=####' where #### is millis,
|
|
|
|
// or a calendar spec ERA=0,YEAR=1, etc.. applied to the calendar type specified by the locale
|
|
|
|
// or RELATIVE_MILLIS=### where ### is a signed value which is added to the current millis
|
|
|
|
// or RELATIVE_ADD:DATE=1 which means that the field "DATE" will be added by +1 relative to current time
|
|
|
|
// str: the expected unicode string
|
|
|
|
|
|
|
|
Cases {
|
|
|
|
{
|
|
|
|
"en_US@calendar=hebrew",
|
|
|
|
"DATE=FULL,TIME=FULL",
|
2008-07-08 20:16:53 +00:00
|
|
|
"MILLIS=3076424179200000",
|
2009-04-10 07:47:09 +00:00
|
|
|
"Friday, Heshvan 3, 103217 12:00:00 AM GMT-08:00"
|
2008-07-02 21:33:33 +00:00
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2007-08-16 18:40:18 +00:00
|
|
|
}
|