]>
git.saurik.com Git - apple/icu.git/blob - icuSources/test/intltest/dtifmtts.cpp
2 /********************************************************************
4 * Copyright (c) 1997-2010, International Business Machines Corporation and
5 * others. All Rights Reserved.
6 ********************************************************************/
8 #include "unicode/utypes.h"
10 #if !UCONFIG_NO_FORMATTING
13 //TODO: define it in compiler flag
14 //#define DTIFMTTS_DEBUG 1
24 #include "unicode/gregocal.h"
25 #include "unicode/dtintrv.h"
26 #include "unicode/dtitvinf.h"
27 #include "unicode/dtitvfmt.h"
32 //#define PRINTMESG(msg) { std::cout << "(" << __FILE__ << ":" << __LINE__ << ") " << msg << "\n"; }
33 #define PRINTMESG(msg) { std::cout << msg; }
36 #define ARRAY_SIZE(array) (sizeof array / sizeof array[0])
41 void DateIntervalFormatTest::runIndexedTest( int32_t index
, UBool exec
, const char* &name
, char* /*par*/ ) {
42 if (exec
) logln("TestSuite DateIntervalFormat");
45 TESTCASE(1, testFormat
);
46 TESTCASE(2, testFormatUserDII
);
47 TESTCASE(3, testStress
);
48 default: name
= ""; break;
53 * Test various generic API methods of DateIntervalFormat for API coverage.
55 void DateIntervalFormatTest::testAPI() {
57 /* ====== Test create interval instance with default locale and skeleton
59 UErrorCode status
= U_ZERO_ERROR
;
60 logln("Testing DateIntervalFormat create instance with default locale and skeleton");
62 DateIntervalFormat
* dtitvfmt
= DateIntervalFormat::createInstance(UDAT_YEAR_MONTH_DAY
, status
);
63 if(U_FAILURE(status
)) {
64 dataerrln("ERROR: Could not create DateIntervalFormat (skeleton + default locale) - exitting");
71 /* ====== Test create interval instance with given locale and skeleton
73 status
= U_ZERO_ERROR
;
74 logln("Testing DateIntervalFormat create instance with given locale and skeleton");
76 dtitvfmt
= DateIntervalFormat::createInstance(UDAT_YEAR_MONTH_DAY
, Locale::getJapanese(), status
);
77 if(U_FAILURE(status
)) {
78 dataerrln("ERROR: Could not create DateIntervalFormat (skeleton + locale) - exitting");
85 /* ====== Test create interval instance with dateIntervalInfo and skeleton
87 status
= U_ZERO_ERROR
;
88 logln("Testing DateIntervalFormat create instance with dateIntervalInfo and skeleton");
90 DateIntervalInfo
* dtitvinf
= new DateIntervalInfo(Locale::getSimplifiedChinese(), status
);
92 dtitvfmt
= DateIntervalFormat::createInstance("EEEdMMMyhms", *dtitvinf
, status
);
95 if(U_FAILURE(status
)) {
96 dataerrln("ERROR: Could not create DateIntervalFormat (skeleton + DateIntervalInfo + default locale) - exitting");
103 /* ====== Test create interval instance with dateIntervalInfo and skeleton
105 status
= U_ZERO_ERROR
;
106 logln("Testing DateIntervalFormat create instance with dateIntervalInfo and skeleton");
108 dtitvinf
= new DateIntervalInfo(Locale::getSimplifiedChinese(), status
);
110 dtitvfmt
= DateIntervalFormat::createInstance("EEEdMMMyhms", Locale::getSimplifiedChinese(), *dtitvinf
, status
);
112 if(U_FAILURE(status
)) {
113 dataerrln("ERROR: Could not create DateIntervalFormat (skeleton + DateIntervalInfo + locale) - exitting");
116 // not deleted, test clone
119 // ====== Test clone()
120 status
= U_ZERO_ERROR
;
121 logln("Testing DateIntervalFormat clone");
123 DateIntervalFormat
* another
= (DateIntervalFormat
*)dtitvfmt
->clone();
124 if ( (*another
) != (*dtitvfmt
) ) {
125 dataerrln("ERROR: clone failed");
129 // ====== Test getDateIntervalInfo, setDateIntervalInfo, adoptDateIntervalInfo
130 status
= U_ZERO_ERROR
;
131 logln("Testing DateIntervalFormat getDateIntervalInfo");
132 const DateIntervalInfo
* inf
= another
->getDateIntervalInfo();
133 dtitvfmt
->setDateIntervalInfo(*inf
, status
);
134 const DateIntervalInfo
* anotherInf
= dtitvfmt
->getDateIntervalInfo();
135 if ( (*inf
) != (*anotherInf
) || U_FAILURE(status
) ) {
136 dataerrln("ERROR: getDateIntervalInfo/setDateIntervalInfo failed");
140 status = U_ZERO_ERROR;
141 DateIntervalInfo* nonConstInf = inf->clone();
142 dtitvfmt->adoptDateIntervalInfo(nonConstInf, status);
143 anotherInf = dtitvfmt->getDateIntervalInfo();
144 if ( (*inf) != (*anotherInf) || U_FAILURE(status) ) {
145 dataerrln("ERROR: adoptDateIntervalInfo failed");
149 // ====== Test getDateFormat, setDateFormat, adoptDateFormat
151 status
= U_ZERO_ERROR
;
152 logln("Testing DateIntervalFormat getDateFormat");
154 const DateFormat* fmt = another->getDateFormat();
155 dtitvfmt->setDateFormat(*fmt, status);
156 const DateFormat* anotherFmt = dtitvfmt->getDateFormat();
157 if ( (*fmt) != (*anotherFmt) || U_FAILURE(status) ) {
158 dataerrln("ERROR: getDateFormat/setDateFormat failed");
161 status = U_ZERO_ERROR;
162 DateFormat* nonConstFmt = (DateFormat*)fmt->clone();
163 dtitvfmt->adoptDateFormat(nonConstFmt, status);
164 anotherFmt = dtitvfmt->getDateFormat();
165 if ( (*fmt) != (*anotherFmt) || U_FAILURE(status) ) {
166 dataerrln("ERROR: adoptDateFormat failed");
172 // ======= Test getStaticClassID()
174 logln("Testing getStaticClassID()");
177 if(dtitvfmt
->getDynamicClassID() != DateIntervalFormat::getStaticClassID()) {
178 errln("ERROR: getDynamicClassID() didn't return the expected value");
183 // ====== test constructor/copy constructor and assignment
184 /* they are protected, no test
185 logln("Testing DateIntervalFormat constructor and assigment operator");
186 status = U_ZERO_ERROR;
188 DateFormat* constFmt = (constFmt*)dtitvfmt->getDateFormat()->clone();
189 inf = dtitvfmt->getDateIntervalInfo()->clone();
192 DateIntervalFormat* dtifmt = new DateIntervalFormat(fmt, inf, status);
193 if(U_FAILURE(status)) {
194 dataerrln("ERROR: Could not create DateIntervalFormat (default) - exitting");
198 DateIntervalFormat* dtifmt2 = new(dtifmt);
199 if ( (*dtifmt) != (*dtifmt2) ) {
200 dataerrln("ERROR: Could not create DateIntervalFormat (default) - exitting");
204 DateIntervalFormat dtifmt3 = (*dtifmt);
205 if ( (*dtifmt) != dtifmt3 ) {
206 dataerrln("ERROR: Could not create DateIntervalFormat (default) - exitting");
216 //===== test format and parse ==================
217 Formattable formattable
;
218 formattable
.setInt64(10);
220 FieldPosition pos
= 0;
221 status
= U_ZERO_ERROR
;
222 dtitvfmt
->format(formattable
, res
, pos
, status
);
223 if ( status
!= U_ILLEGAL_ARGUMENT_ERROR
) {
224 dataerrln("ERROR: format non-date-interval object should set U_ILLEGAL_ARGUMENT_ERROR - exitting");
228 DateInterval
* dtitv
= new DateInterval(3600*24*365, 3600*24*366);
229 formattable
.adoptObject(dtitv
);
232 status
= U_ZERO_ERROR
;
233 dtitvfmt
->format(formattable
, res
, pos
, status
);
234 if ( U_FAILURE(status
) ) {
235 dataerrln("ERROR: format date interval failed - exitting");
239 const DateFormat
* dfmt
= dtitvfmt
->getDateFormat();
240 Calendar
* fromCal
= dfmt
->getCalendar()->clone();
241 Calendar
* toCal
= dfmt
->getCalendar()->clone();
244 status
= U_ZERO_ERROR
;
245 dtitvfmt
->format(*fromCal
, *toCal
, res
, pos
, status
);
246 if ( U_FAILURE(status
) ) {
247 dataerrln("ERROR: format date interval failed - exitting");
254 Formattable fmttable
;
255 status
= U_ZERO_ERROR
;
256 // TODO: why do I need cast?
257 ((Format
*)dtitvfmt
)->parseObject(res
, fmttable
, status
);
258 if ( status
!= U_INVALID_FORMAT_ERROR
) {
259 dataerrln("ERROR: parse should set U_INVALID_FORMAT_ERROR - exitting");
265 //====== test format in testFormat()
267 //====== test DateInterval class (better coverage)
268 DateInterval
dtitv1(3600*24*365, 3600*24*366);
269 DateInterval
dtitv2(dtitv1
);
271 if (!(dtitv1
== dtitv2
)) {
272 errln("ERROR: Copy constructor failed for DateInterval.");
275 DateInterval
dtitv3(3600*365, 3600*366);
277 if (!(dtitv3
== dtitv1
)) {
278 errln("ERROR: Equal operator failed for DateInterval.");
281 DateInterval
*dtitv4
= dtitv1
.clone();
282 if (*dtitv4
!= dtitv1
) {
283 errln("ERROR: Equal operator failed for DateInterval.");
292 void DateIntervalFormatTest::testFormat() {
293 // first item is date pattern
294 // followed by a group of locale/from_data/to_data/skeleton/interval_data
295 const char* DATA
[] = {
296 "yyyy MM dd HH:mm:ss",
298 "root", "2007 11 10 10:10:10", "2007 12 10 10:10:10", "yM", "2007-11 \\u2013 12",
300 // test 'H' and 'h', using availableFormat in fallback
301 "en", "2007 11 10 10:10:10", "2007 11 10 15:10:10", "Hms", "10:10:10 \\u2013 15:10:10",
302 "en", "2007 11 10 10:10:10", "2007 11 10 15:10:10", "hms", "10:10:10 AM \\u2013 3:10:10 PM",
304 "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "MMMM", "October 2007 \\u2013 October 2008",
305 "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "MMM", "Oct 2007 \\u2013 Oct 2008",
306 // test skeleton with both date and time
307 "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "dMMMyhm", "Nov 10, 2007 10:10 AM \\u2013 Nov 20, 2007 10:10 AM",
309 "en", "2007 11 10 10:10:10", "2007 11 10 11:10:10", "dMMMyhm", "Nov 10, 2007 10:10\\u201311:10 AM",
311 "en", "2007 11 10 10:10:10", "2007 11 10 11:10:10", "hms", "10:10:10 AM \\u2013 11:10:10 AM",
312 "en", "2007 11 10 10:10:10", "2007 11 10 11:10:10", "Hms", "10:10:10 \\u2013 11:10:10",
313 "en", "2007 11 10 20:10:10", "2007 11 10 21:10:10", "Hms", "20:10:10 \\u2013 21:10:10",
315 "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "EEEEdMMMMy", "Wednesday, October 10, 2007 \\u2013 Friday, October 10, 2008",
317 "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "dMMMMy", "October 10, 2007 \\u2013 October 10, 2008",
319 "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "dMMMM", "October 10, 2007 \\u2013 October 10, 2008",
321 "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "MMMMy", "October 2007 \\u2013 October 2008",
323 "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "EEEEdMMMM", "Wednesday, October 10, 2007 \\u2013 Friday, October 10, 2008",
325 "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "EdMMMy", "Wed, Oct 10, 2007 \\u2013 Fri, Oct 10, 2008",
327 "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "dMMMy", "Oct 10, 2007 \\u2013 Oct 10, 2008",
329 "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "dMMM", "Oct 10, 2007 \\u2013 Oct 10, 2008",
331 "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "MMMy", "Oct 2007 \\u2013 Oct 2008",
333 "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "EdMMM", "Wed, Oct 10, 2007 \\u2013 Fri, Oct 10, 2008",
335 "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "EdMy", "Wed, 10/10/07 \\u2013 Fri, 10/10/08",
337 "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "dMy", "10/10/07 \\u2013 10/10/08",
339 "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "dM", "10/10/07 \\u2013 10/10/08",
341 "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "My", "10/07 \\u2013 10/08",
343 "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "EdM", "Wed, 10/10/07 \\u2013 Fri, 10/10/08",
345 "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "d", "10/10/07 \\u2013 10/10/08",
347 "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "Ed", "10 Wed \\u2013 10 Fri",
349 "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "y", "2007\\u20132008",
351 "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "M", "10/07 \\u2013 10/08",
355 "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "hm", "10/10/2007 10:10 AM \\u2013 10/10/2008 10:10 AM",
356 "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "Hm", "10/10/2007 10:10 \\u2013 10/10/2008 10:10",
357 "en", "2007 10 10 20:10:10", "2008 10 10 20:10:10", "Hm", "10/10/2007 20:10 \\u2013 10/10/2008 20:10",
359 "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "hmv", "10/10/2007 10:10 AM PT \\u2013 10/10/2008 10:10 AM PT",
361 "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "hmz", "10/10/2007 10:10 AM PDT \\u2013 10/10/2008 10:10 AM PDT",
363 "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "h", "10/10/2007 10 AM \\u2013 10/10/2008 10 AM",
365 "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "hv", "10/10/2007 10 AM PT \\u2013 10/10/2008 10 AM PT",
367 "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "hz", "10/10/2007 10 AM PDT \\u2013 10/10/2008 10 AM PDT",
369 "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "EEddMMyyyy", "Wed, 10/10/07 \\u2013 Fri, 10/10/08",
371 "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "EddMMy", "Wed, 10/10/07 \\u2013 Fri, 10/10/08",
373 "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "hhmm", "10/10/2007 10:10 AM \\u2013 10/10/2008 10:10 AM",
375 "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "hhmmzz", "10/10/2007 10:10 AM PDT \\u2013 10/10/2008 10:10 AM PDT",
377 "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "hms", "10/10/2007 10:10:10 AM \\u2013 10/10/2008 10:10:10 AM",
379 "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "dMMMMMy", "O 10, 2007 \\u2013 O 10, 2008",
381 "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "EEEEEdM", "W, 10/10/07 \\u2013 F, 10/10/08",
383 "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "EEEEdMMMMy", "Wednesday, October 10 \\u2013 Saturday, November 10, 2007",
385 "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "dMMMMy", "October 10 \\u2013 November 10, 2007",
387 "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "dMMMM", "October 10 \\u2013 November 10",
389 "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "MMMMy", "October\\u2013November 2007",
391 "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "EEEEdMMMM", "Wednesday, October 10 \\u2013 Saturday, November 10",
393 "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "EdMMMy", "Wed, Oct 10 \\u2013 Sat, Nov 10, 2007",
395 "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "dMMMy", "Oct 10 \\u2013 Nov 10, 2007",
397 "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "dMMM", "Oct 10 \\u2013 Nov 10",
399 "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "MMMy", "Oct\\u2013Nov 2007",
401 "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "EdMMM", "Wed, Oct 10 \\u2013 Sat, Nov 10",
403 "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "EdMy", "Wed, 10/10/07 \\u2013 Sat, 11/10/07",
405 "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "dMy", "10/10/07 \\u2013 11/10/07",
408 "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "My", "10/07 \\u2013 11/07",
410 "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "EdM", "Wed, 10/10 \\u2013 Sat, 11/10",
412 "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "d", "10/10 \\u2013 11/10",
414 "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "Ed", "10 Wed \\u2013 10 Sat",
416 "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "y", "2007",
418 "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "M", "10\\u201311",
420 "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "MMM", "Oct\\u2013Nov",
422 "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "MMMM", "October-November",
424 "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "hm", "10/10/2007 10:10 AM \\u2013 11/10/2007 10:10 AM",
425 "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "Hm", "10/10/2007 10:10 \\u2013 11/10/2007 10:10",
426 "en", "2007 10 10 20:10:10", "2007 11 10 20:10:10", "Hm", "10/10/2007 20:10 \\u2013 11/10/2007 20:10",
428 "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "hmv", "10/10/2007 10:10 AM PT \\u2013 11/10/2007 10:10 AM PT",
430 "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "hmz", "10/10/2007 10:10 AM PDT \\u2013 11/10/2007 10:10 AM PST",
432 "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "h", "10/10/2007 10 AM \\u2013 11/10/2007 10 AM",
434 "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "hv", "10/10/2007 10 AM PT \\u2013 11/10/2007 10 AM PT",
436 "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "hz", "10/10/2007 10 AM PDT \\u2013 11/10/2007 10 AM PST",
438 "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "EEddMMyyyy", "Wed, 10/10/07 \\u2013 Sat, 11/10/07",
440 "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "EddMMy", "Wed, 10/10/07 \\u2013 Sat, 11/10/07",
443 "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "hhmmzz", "10/10/2007 10:10 AM PDT \\u2013 11/10/2007 10:10 AM PST",
445 "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "hms", "10/10/2007 10:10:10 AM \\u2013 11/10/2007 10:10:10 AM",
447 "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "dMMMMMy", "O 10 \\u2013 N 10, 2007",
449 "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "EEEEEdM", "W, 10/10 \\u2013 S, 11/10",
451 "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "EEEEdMMMMy", "Saturday, November 10 \\u2013 Tuesday, November 20, 2007",
453 "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "dMMMMy", "November 10\\u201320, 2007",
455 "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "dMMMM", "November 10\\u201320",
458 "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "EEEEdMMMM", "Saturday, November 10 \\u2013 Tuesday, November 20",
460 "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "EdMMMy", "Sat, Nov 10 \\u2013 Tue, Nov 20, 2007",
462 "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "dMMMy", "Nov 10\\u201320, 2007",
464 "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "dMMM", "Nov 10\\u201320",
466 "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "MMMy", "Nov 2007",
468 "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "EdMMM", "Sat, Nov 10 \\u2013 Tue, Nov 20",
470 "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "EdMy", "Sat, 11/10/07 \\u2013 Tue, 11/20/07",
472 "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "dMy", "11/10/07 \\u2013 11/20/07",
474 "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "dM", "11/10 \\u2013 11/20",
476 "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "My", "11/2007",
478 "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "EdM", "Sat, 11/10 \\u2013 Tue, 11/20",
480 "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "d", "10\\u201320",
482 "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "Ed", "10 Sat \\u2013 20 Tue",
484 "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "y", "2007",
486 "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "M", "11",
488 "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "MMM", "Nov",
490 "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "MMMM", "November",
492 "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "hm", "11/10/2007 10:10 AM \\u2013 11/20/2007 10:10 AM",
493 "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "Hm", "11/10/2007 10:10 \\u2013 11/20/2007 10:10",
494 "en", "2007 11 10 20:10:10", "2007 11 20 20:10:10", "Hm", "11/10/2007 20:10 \\u2013 11/20/2007 20:10",
496 "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "hmv", "11/10/2007 10:10 AM PT \\u2013 11/20/2007 10:10 AM PT",
498 "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "hmz", "11/10/2007 10:10 AM PST \\u2013 11/20/2007 10:10 AM PST",
500 "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "h", "11/10/2007 10 AM \\u2013 11/20/2007 10 AM",
502 "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "hv", "11/10/2007 10 AM PT \\u2013 11/20/2007 10 AM PT",
504 "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "hz", "11/10/2007 10 AM PST \\u2013 11/20/2007 10 AM PST",
506 "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "EEddMMyyyy", "Sat, 11/10/07 \\u2013 Tue, 11/20/07",
508 "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "EddMMy", "Sat, 11/10/07 \\u2013 Tue, 11/20/07",
510 "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "hhmm", "11/10/2007 10:10 AM \\u2013 11/20/2007 10:10 AM",
512 "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "hhmmzz", "11/10/2007 10:10 AM PST \\u2013 11/20/2007 10:10 AM PST",
514 "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "hms", "11/10/2007 10:10:10 AM \\u2013 11/20/2007 10:10:10 AM",
515 "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "Hms", "11/10/2007 10:10:10 \\u2013 11/20/2007 10:10:10",
516 "en", "2007 11 10 20:10:10", "2007 11 20 20:10:10", "Hms", "11/10/2007 20:10:10 \\u2013 11/20/2007 20:10:10",
518 "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "dMMMMMy", "N 10\\u201320, 2007",
520 "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "EEEEEdM", "S, 11/10 \\u2013 T, 11/20",
522 "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "EEEEdMMMMy", "Wednesday, January 10, 2007",
524 "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "dMMMMy", "January 10, 2007",
526 "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "dMMMM", "January 10",
528 "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "MMMMy", "January 2007",
530 "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "EEEEdMMMM", "Wednesday, January 10",
532 "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "EdMMMy", "Wed, Jan 10, 2007",
534 "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "dMMMy", "Jan 10, 2007",
536 "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "dMMM", "Jan 10",
538 "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "MMMy", "Jan 2007",
540 "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "EdMMM", "Wed, Jan 10",
543 "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "dMy", "1/10/2007",
545 "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "dM", "1/10",
547 "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "My", "1/2007",
549 "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "EdM", "Wed, 1/10",
551 "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "d", "10",
553 "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "Ed", "10 Wed",
555 "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "y", "2007",
557 "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "M", "1",
559 "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "MMM", "Jan",
561 "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "MMMM", "January",
563 "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "hm", "10:00 AM \\u2013 2:10 PM",
564 "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "Hm", "10:00 \\u2013 14:10",
566 "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "hmv", "10:00 AM \\u2013 2:10 PM PT",
568 "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "hmz", "10:00 AM \\u2013 2:10 PM PST",
570 "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "h", "10 AM \\u2013 2 PM",
571 "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "H", "10 \\u2013 14",
574 "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "hz", "10 AM \\u2013 2 PM PST",
576 "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "EEddMMyyyy", "Wed, 01/10/2007",
578 "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "EddMMy", "Wed, 01/10/2007",
580 "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "hhmm", "10:00 AM \\u2013 2:10 PM",
581 "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "HHmm", "10:00 \\u2013 14:10",
583 "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "hhmmzz", "10:00 AM \\u2013 2:10 PM PST",
585 "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "hms", "10:00:10 AM \\u2013 2:10:10 PM",
586 "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "Hms", "10:00:10 \\u2013 14:10:10",
588 "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "dMMMMMy", "J 10, 2007",
590 "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "EEEEEdM", "W, 1/10",
591 "en", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "dMMMMy", "January 10, 2007",
593 "en", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "dMMMM", "January 10",
595 "en", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "MMMMy", "January 2007",
597 "en", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "EEEEdMMMM", "Wednesday, January 10",
599 "en", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "EdMMMy", "Wed, Jan 10, 2007",
601 "en", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "dMMMy", "Jan 10, 2007",
603 "en", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "dMMM", "Jan 10",
606 "en", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "EdMMM", "Wed, Jan 10",
608 "en", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "EdMy", "Wed, 1/10/2007",
610 "en", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "dMy", "1/10/2007",
613 "en", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "My", "1/2007",
615 "en", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "EdM", "Wed, 1/10",
617 "en", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "d", "10",
620 "en", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "y", "2007",
622 "en", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "M", "1",
626 "en", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "hm", "10:00\\u201310:20 AM",
627 "en", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "Hm", "10:00 \\u2013 10:20",
630 "en", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "hmz", "10:00\\u201310:20 AM PST",
633 "en", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "hv", "10 AM PT",
637 "en", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "EddMMy", "Wed, 01/10/2007",
639 "en", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "hhmm", "10:00\\u201310:20 AM",
640 "en", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "HHmm", "10:00 \\u2013 10:20",
642 "en", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "hhmmzz", "10:00\\u201310:20 AM PST",
645 "en", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "dMMMMMy", "J 10, 2007",
648 "en", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "EEEEdMMMMy", "Wednesday, January 10, 2007",
650 "en", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "dMMMMy", "January 10, 2007",
653 "en", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "MMMMy", "January 2007",
655 "en", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "EEEEdMMMM", "Wednesday, January 10",
658 "en", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "dMMMy", "Jan 10, 2007",
660 "en", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "dMMM", "Jan 10",
663 "en", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "EdMMM", "Wed, Jan 10",
665 "en", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "EdMy", "Wed, 1/10/2007",
667 "en", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "dMy", "1/10/2007",
670 "en", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "My", "1/2007",
672 "en", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "EdM", "Wed, 1/10",
674 "en", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "d", "10",
677 "en", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "y", "2007",
679 "en", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "M", "1",
682 "en", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "MMMM", "January",
684 "en", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "hm", "10:10 AM",
685 "en", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "Hm", "10:10",
688 "en", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "hmz", "10:10 AM PST",
690 "en", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "h", "10 AM",
692 "en", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "hv", "10 AM PT",
695 "en", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "EEddMMyyyy", "Wed, 01/10/2007",
698 "en", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "hhmm", "10:10 AM",
699 "en", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "HHmm", "10:10",
701 "en", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "hhmmzz", "10:10 AM PST",
704 "en", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "dMMMMMy", "J 10, 2007",
706 "en", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "EEEEEdM", "W, 1/10",
708 "zh", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "EEEEdMMMMy", "2007\\u5e7410\\u670810\\u65e5\\u661f\\u671f\\u4e09\\u81f32008\\u5e7410\\u670810\\u65e5\\u661f\\u671f\\u4e94",
711 "zh", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "dMMMMy", "2007\\u5e7410\\u670810\\u65e5\\u81f311\\u670810\\u65e5",
714 "zh", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "MMMMy", "2007\\u5e7410\\u6708\\u81f311\\u6708",
717 "zh", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "hmv", "2007\\u5e7410\\u670810\\u65e5 \\u4e0a\\u534810:10 \\u7f8e\\u56fd (\\u6d1b\\u6749\\u77f6)\\u81f32007\\u5e7411\\u670810\\u65e5 \\u4e0a\\u534810:10 \\u7f8e\\u56fd (\\u6d1b\\u6749\\u77f6)",
719 "zh", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "EEEEdMMMMy", "2007\\u5e7411\\u670810\\u65e5\\u661f\\u671f\\u516d\\u81f320\\u65e5\\u661f\\u671f\\u4e8c",
722 "zh", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "dMMMM", "11\\u670810\\u65e5\\u81f320\\u65e5",
724 "zh", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "MMMMy", "2007\\u5E7411\\u6708", // (fixed expected result per ticket:6626:)
726 "zh", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "EEEEdMMMM", "11\\u670810\\u65e5\\u661f\\u671f\\u516d\\u81f320\\u65e5\\u661f\\u671f\\u4e8c",
729 "zh", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "EdMy", "07-11-10\\u5468\\u516d\\u81f307-11-20\\u5468\\u4e8c",
732 "zh", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "dM", "11-10\\u81f311-20",
734 "zh", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "My", "2007-11",
736 "zh", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "EdM", "11-10\\u5468\\u516d\\u81f311-20\\u5468\\u4e8c",
739 "zh", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "y", "2007\\u5E74", // (fixed expected result per ticket:6626:)
741 "zh", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "M", "11\\u6708",
743 "zh", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "MMM", "\\u5341\\u4E00\\u6708", // (fixed expected result per ticket:6626: and others)
746 "zh", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "hmz", "2007\\u5e7411\\u670810\\u65e5 \\u4e0a\\u534810:10 \\u683c\\u6797\\u5c3c\\u6cbb\\u6807\\u51c6\\u65f6\\u95f4-0800\\u81f32007\\u5e7411\\u670820\\u65e5 \\u4e0a\\u534810:10 \\u683c\\u6797\\u5c3c\\u6cbb\\u6807\\u51c6\\u65f6\\u95f4-0800",
748 "zh", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "h", "2007\\u5e7411\\u670810\\u65e5 \\u4e0a\\u534810\\u65f6\\u81f32007\\u5e7411\\u670820\\u65e5 \\u4e0a\\u534810\\u65f6",
750 "zh", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "EEEEdMMMMy", "2007\\u5e741\\u670810\\u65e5\\u661f\\u671f\\u4e09", // (fixed expected result per ticket:6626:)
752 "zh", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "hm", "\\u4e0a\\u534810:00\\u81f3\\u4e0b\\u53482:10",
755 "zh", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "hmz", "\\u683c\\u6797\\u5c3c\\u6cbb\\u6807\\u51c6\\u65f6\\u95f4-0800\\u4e0a\\u534810:00\\u81f3\\u4e0b\\u53482:10",
757 "zh", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "h", "\\u4e0a\\u534810\\u81f3\\u4e0b\\u53482\\u65f6",
759 "zh", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "hv", "\\u7f8e\\u56fd (\\u6d1b\\u6749\\u77f6)\\u4e0a\\u534810\\u81f3\\u4e0b\\u53482\\u65f6",
761 "zh", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "hm", "\\u4e0a\\u534810:00\\u81f310:20",
763 "zh", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "hmv", "\\u7f8e\\u56fd (\\u6d1b\\u6749\\u77f6)\\u4e0a\\u534810:00\\u81f310:20",
765 "zh", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "hz", "\\u4e0a\\u534810\\u65f6 \\u683c\\u6797\\u5c3c\\u6cbb\\u6807\\u51c6\\u65f6\\u95f4-0800",
767 "zh", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "hm", "\\u4e0a\\u534810:10",
769 "zh", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "h", "\\u4e0a\\u534810\\u65f6",
771 "de", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "EEEEdMMMy", "Mittwoch, 10. Okt 2007 - Freitag, 10. Okt 2008",
774 "de", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "dMMM", "10. Okt 2007 - 10. Okt 2008",
776 "de", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "MMMy", "Okt 2007 - Okt 2008",
779 "de", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "EdMy", "Mi., 10.10.07 - Fr., 10.10.08",
781 "de", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "dMy", "10.10.07 - 10.10.08",
784 "de", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "My", "10.07 - 10.08",
786 "de", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "EdM", "Mi., 10.10.07 - Fr., 10.10.08",
789 "de", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "y", "2007-2008",
791 "de", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "M", "10.07 - 10.08",
794 "de", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "hm", "10.10.2007 10:10 vorm. - 10.10.2008 10:10 vorm.",
795 "de", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "Hm", "10.10.2007 10:10 - 10.10.2008 10:10",
797 "de", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "EEEEdMMMy", "Mittwoch, 10. Okt - Samstag, 10. Nov 2007",
800 "de", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "dMMM", "10. Okt - 10. Nov",
802 "de", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "MMMy", "Okt-Nov 2007",
804 "de", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "EEEEdMMM", "Mittwoch, 10. Okt - Samstag, 10. Nov",
807 "de", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "dM", "10.10. - 10.11.",
809 "de", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "My", "10.07 - 11.07",
812 "de", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "d", "10.10. - 10.11.",
814 "de", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "y", "2007",
817 "de", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "MMM", "Okt-Nov",
820 "de", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "hms", "10.10.2007 10:10:10 vorm. - 10.11.2007 10:10:10 vorm.",
821 "de", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "Hms", "10.10.2007 10:10:10 - 10.11.2007 10:10:10",
823 "de", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "EEEEdMMMy", "Samstag, 10. - Dienstag, 20. Nov 2007",
825 "de", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "dMMMy", "10.-20. Nov 2007",
828 "de", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "MMMy", "Nov 2007",
830 "de", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "EEEEdMMM", "Samstag, 10. - Dienstag, 20. Nov",
832 "de", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "EdMy", "Sa., 10.11.07 - Di., 20.11.07",
835 "de", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "dM", "10.11. - 20.11.",
837 "de", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "My", "11.2007",
840 "de", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "d", "10.-20.",
842 "de", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "y", "2007",
845 "de", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "hmv", "10.11.2007 10:10 vorm. Vereinigte Staaten (Los Angeles) - 20.11.2007 10:10 vorm. Vereinigte Staaten (Los Angeles)",
847 "de", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "EEEEdMMMy", "Mittwoch, 10. Jan 2007",
850 "de", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "dMMM", "10. Jan",
852 "de", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "MMMy", "Jan 2007",
854 "de", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "EEEEdMMM", "Mittwoch, 10. Jan",
857 "de", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "h", "10 vorm. - 2 nachm.",
858 "de", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "H", "10-14 Uhr",
860 "de", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "EEEEdMMM", "Mittwoch, 10. Jan",
863 "de", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "hmv", "10:00-10:20 vorm. Vereinigte Staaten (Los Angeles)",
865 "de", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "hmz", "10:00-10:20 vorm. GMT-08:00",
867 "de", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "h", "10 vorm.",
868 "de", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "H", "10 Uhr",
871 "de", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "hz", "10 vorm. GMT-08:00",
873 "de", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "EEEEdMMMy", "Mittwoch, 10. Jan 2007",
876 "de", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "hmv", "10:10 vorm. Vereinigte Staaten (Los Angeles)",
878 "de", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "hmz", "10:10 vorm. GMT-08:00",
881 "de", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "hv", "10 vorm. Vereinigte Staaten (Los Angeles)",
883 "de", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "hz", "10 vorm. GMT-08:00",
885 // Thai (default calendar buddhist)
887 "th", "2550 10 10 10:10:10", "2551 10 10 10:10:10", "EEEEdMMMy", "\\u0E27\\u0E31\\u0E19\\u0E1E\\u0E38\\u0E18 10 \\u0E15.\\u0E04. 2550 - \\u0E27\\u0E31\\u0E19\\u0E28\\u0E38\\u0E01\\u0E23\\u0E4C 10 \\u0E15.\\u0E04. 2551",
890 "th", "2550 10 10 10:10:10", "2551 10 10 10:10:10", "dMMM", "10 \\u0E15.\\u0E04. 2550 - 10 \\u0E15.\\u0E04. 2551",
892 "th", "2550 10 10 10:10:10", "2551 10 10 10:10:10", "MMMy", "\\u0E15.\\u0E04. 2550 - \\u0E15.\\u0E04. 2551",
895 "th", "2550 10 10 10:10:10", "2551 10 10 10:10:10", "EdMy", "\\u0E1E. 10/10/50 - \\u0E28. 10/10/51",
897 "th", "2550 10 10 10:10:10", "2551 10 10 10:10:10", "dMy", "10/10/50 - 10/10/51",
900 "th", "2550 10 10 10:10:10", "2551 10 10 10:10:10", "My", "10/50 - 10/51",
902 "th", "2550 10 10 10:10:10", "2551 10 10 10:10:10", "EdM", "\\u0E1E. 10/10/50 - \\u0E28. 10/10/51",
905 "th", "2550 10 10 10:10:10", "2551 10 10 10:10:10", "y", "2550-2551",
907 "th", "2550 10 10 10:10:10", "2551 10 10 10:10:10", "M", "10/50 - 10/51",
910 "th", "2550 10 10 10:10:10", "2550 11 10 10:10:10", "EEEEdMMMy", "\\u0E27\\u0E31\\u0E19\\u0E1E\\u0E38\\u0E18 10 \\u0E15.\\u0E04. - \\u0E27\\u0E31\\u0E19\\u0E40\\u0E2A\\u0E32\\u0E23\\u0E4C 10 \\u0E1E.\\u0E22. 2550",
913 "th", "2550 10 10 10:10:10", "2550 11 10 10:10:10", "dMMM", "10 \\u0E15.\\u0E04. - 10 \\u0E1E.\\u0E22.",
915 "th", "2550 10 10 10:10:10", "2550 11 10 10:10:10", "MMMy", "\\u0E15.\\u0E04.-\\u0E1E.\\u0E22. 2550",
917 "th", "2550 10 10 10:10:10", "2550 11 10 10:10:10", "dM", "10/10 - 10/11",
919 "th", "2550 10 10 10:10:10", "2550 11 10 10:10:10", "My", "10/50 - 11/50",
922 "th", "2550 10 10 10:10:10", "2550 11 10 10:10:10", "d", "10/10 - 10/11",
924 "th", "2550 10 10 10:10:10", "2550 11 10 10:10:10", "y", "2550",
927 "th", "2550 10 10 10:10:10", "2550 11 10 10:10:10", "MMM", "\\u0E15.\\u0E04.-\\u0E1E.\\u0E22.",
930 expect(DATA
, ARRAY_SIZE(DATA
));
934 void DateIntervalFormatTest::expect(const char** data
, int32_t data_length
) {
936 UErrorCode ec
= U_ZERO_ERROR
;
937 UnicodeString str
, str2
;
938 const char* pattern
= data
[0];
941 #ifdef DTIFMTTS_DEBUG
944 sprintf(mesg
, "locale: %s\n", locName
);
948 while (i
<data_length
) {
949 const char* locName
= data
[i
++];
951 SimpleDateFormat
ref(pattern
, loc
, ec
);
953 dataerrln("contruct SimpleDateFormat in expect failed: %s", u_errorName(ec
));
957 const char* datestr
= data
[i
++];
958 const char* datestr_2
= data
[i
++];
959 #ifdef DTIFMTTS_DEBUG
960 sprintf(mesg
, "original date: %s - %s\n", datestr
, datestr_2
);
963 UDate date
= ref
.parse(ctou(datestr
), ec
);
964 if (!assertSuccess("parse 1st data in expect", ec
)) return;
965 UDate date_2
= ref
.parse(ctou(datestr_2
), ec
);
966 if (!assertSuccess("parse 2nd data in expect", ec
)) return;
967 DateInterval
dtitv(date
, date_2
);
969 const UnicodeString
& oneSkeleton
= data
[i
++];
971 DateIntervalFormat
* dtitvfmt
= DateIntervalFormat::createInstance(oneSkeleton
, loc
, ec
);
972 if (!assertSuccess("createInstance(skeleton) in expect", ec
)) return;
974 dtitvfmt
->format(&dtitv
, str
.remove(), pos
, ec
);
975 if (!assertSuccess("format in expect", ec
)) return;
976 assertEquals((UnicodeString
)"\"" + locName
+ "\\" + oneSkeleton
+ "\\" + datestr
+ "\\" + datestr_2
+ "\"", ctou(data
[i
++]), str
);
980 #ifdef DTIFMTTS_DEBUG
981 str
.extract(0, str
.length(), result
, "UTF-8");
982 sprintf(mesg
, "interval date: %s\n", result
);
985 std::cout
<< "\"" << locName
<< "\", "
986 << "\"" << datestr
<< "\", "
987 << "\"" << datestr_2
<< "\", ";
988 printUnicodeString(oneSkeleton
);
989 printUnicodeString(str
);
998 * Test format using user defined DateIntervalInfo
1000 void DateIntervalFormatTest::testFormatUserDII() {
1001 // first item is date pattern
1002 const char* DATA
[] = {
1003 "yyyy MM dd HH:mm:ss",
1004 "en", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "Oct 10, 2007 --- Oct 10, 2008",
1006 "en", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "2007 Oct 10 - Nov 2007",
1008 "en", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "Nov 10, 2007 --- Nov 20, 2007",
1010 "en", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "Jan 10, 2007",
1012 "en", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "Jan 10, 2007",
1014 "en", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "Jan 10, 2007",
1016 "zh", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "2007\\u5e7410\\u670810\\u65e5 --- 2008\\u5e7410\\u670810\\u65e5",
1018 "zh", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "2007 10\\u6708 10 - 11\\u6708 2007",
1020 "zh", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "2007\\u5e7411\\u670810\\u65e5 --- 2007\\u5e7411\\u670820\\u65e5",
1022 "zh", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "2007\\u5e741\\u670810\\u65e5", // (fixed expected result per ticket:6626:)
1024 "zh", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "2007\\u5e741\\u670810\\u65e5", // (fixed expected result per ticket:6626:)
1026 "zh", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "2007\\u5e741\\u670810\\u65e5", // (fixed expected result per ticket:6626:)
1028 "de", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "10. Okt 2007 --- 10. Okt 2008",
1031 "de", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "10. Nov 2007 --- 20. Nov 2007",
1033 "de", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "10. Jan 2007",
1035 "de", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "10. Jan 2007",
1038 "es", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "10 de oct de 2007 --- 10 de oct de 2008",
1040 "es", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "2007 oct 10 - nov 2007",
1042 "es", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "10 de nov de 2007 --- 20 de nov de 2007",
1044 "es", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "10 de ene de 2007",
1046 "es", "2007 01 10 10:00:10", "2007 01 10 10:20:10", "10 de ene de 2007",
1048 "es", "2007 01 10 10:10:10", "2007 01 10 10:10:20", "10 de ene de 2007",
1050 expectUserDII(DATA
, ARRAY_SIZE(DATA
));
1054 void DateIntervalFormatTest::expectUserDII(const char** data
,
1055 int32_t data_length
) {
1058 UErrorCode ec
= U_ZERO_ERROR
;
1059 const char* pattern
= data
[0];
1062 while ( i
< data_length
) {
1063 const char* locName
= data
[i
++];
1064 Locale
loc(locName
);
1065 SimpleDateFormat
ref(pattern
, loc
, ec
);
1066 if (U_FAILURE(ec
)) {
1067 dataerrln("contruct SimpleDateFormat in expectUserDII failed: %s", u_errorName(ec
));
1070 const char* datestr
= data
[i
++];
1071 const char* datestr_2
= data
[i
++];
1072 UDate date
= ref
.parse(ctou(datestr
), ec
);
1073 if (!assertSuccess("parse in expectUserDII", ec
)) return;
1074 UDate date_2
= ref
.parse(ctou(datestr_2
), ec
);
1075 if (!assertSuccess("parse in expectUserDII", ec
)) return;
1076 DateInterval
dtitv(date
, date_2
);
1079 // test user created DateIntervalInfo
1080 DateIntervalInfo
* dtitvinf
= new DateIntervalInfo(ec
);
1081 dtitvinf
->setFallbackIntervalPattern("{0} --- {1}", ec
);
1082 dtitvinf
->setIntervalPattern(UDAT_YEAR_ABBR_MONTH_DAY
, UCAL_MONTH
, "yyyy MMM d - MMM y",ec
);
1083 if (!assertSuccess("DateIntervalInfo::setIntervalPattern", ec
)) return;
1084 dtitvinf
->setIntervalPattern(UDAT_YEAR_ABBR_MONTH_DAY
, UCAL_HOUR_OF_DAY
, "yyyy MMM d HH:mm - HH:mm", ec
);
1085 if (!assertSuccess("DateIntervalInfo::setIntervalPattern", ec
)) return;
1086 DateIntervalFormat
* dtitvfmt
= DateIntervalFormat::createInstance(UDAT_YEAR_ABBR_MONTH_DAY
, loc
, *dtitvinf
, ec
);
1088 if (!assertSuccess("createInstance(skeleton,dtitvinf) in expectUserDII", ec
)) return;
1089 FieldPosition pos
=0;
1090 dtitvfmt
->format(&dtitv
, str
.remove(), pos
, ec
);
1091 if (!assertSuccess("format in expectUserDII", ec
)) return;
1092 assertEquals((UnicodeString
)"\"" + locName
+ "\\" + datestr
+ "\\" + datestr_2
+ "\"", ctou(data
[i
++]), str
);
1093 #ifdef DTIFMTTS_DEBUG
1096 PRINTMESG("interval format using user defined DateIntervalInfo\n");
1097 str
.extract(0, str
.length(), result
, "UTF-8");
1098 sprintf(mesg
, "interval date: %s\n", result
);
1106 void DateIntervalFormatTest::testStress() {
1108 logln("Quick mode: Skipping test");
1111 const char* DATA
[] = {
1112 "yyyy MM dd HH:mm:ss",
1113 "2007 10 10 10:10:10", "2008 10 10 10:10:10",
1114 "2007 10 10 10:10:10", "2007 11 10 10:10:10",
1115 "2007 11 10 10:10:10", "2007 11 20 10:10:10",
1116 "2007 01 10 10:00:10", "2007 01 10 14:10:10",
1117 "2007 01 10 10:00:10", "2007 01 10 10:20:10",
1118 "2007 01 10 10:10:10", "2007 01 10 10:10:20",
1121 const char* testLocale
[][3] = {
1163 uint32_t localeIndex
;
1164 for ( localeIndex
= 0; localeIndex
< ARRAY_SIZE(testLocale
); ++localeIndex
) {
1166 uprv_strcpy(locName
, testLocale
[localeIndex
][0]);
1167 uprv_strcat(locName
, testLocale
[localeIndex
][1]);
1168 stress(DATA
, ARRAY_SIZE(DATA
), Locale(testLocale
[localeIndex
][0], testLocale
[localeIndex
][1], testLocale
[localeIndex
][2]), locName
);
1173 void DateIntervalFormatTest::stress(const char** data
, int32_t data_length
,
1174 const Locale
& loc
, const char* locName
) {
1175 UnicodeString skeleton
[] = {
1203 "EEddMMyyyy", // following could be normalized
1207 "hms", // following could not be normalized
1213 UErrorCode ec
= U_ZERO_ERROR
;
1214 UnicodeString str
, str2
;
1215 SimpleDateFormat
ref(data
[i
++], loc
, ec
);
1216 if (!assertSuccess("construct SimpleDateFormat", ec
)) return;
1218 #ifdef DTIFMTTS_DEBUG
1221 sprintf(mesg
, "locale: %s\n", locName
);
1225 while (i
<data_length
) {
1228 const char* datestr
= data
[i
++];
1229 const char* datestr_2
= data
[i
++];
1230 #ifdef DTIFMTTS_DEBUG
1231 sprintf(mesg
, "original date: %s - %s\n", datestr
, datestr_2
);
1234 UDate date
= ref
.parse(ctou(datestr
), ec
);
1235 if (!assertSuccess("parse", ec
)) return;
1236 UDate date_2
= ref
.parse(ctou(datestr_2
), ec
);
1237 if (!assertSuccess("parse", ec
)) return;
1238 DateInterval
dtitv(date
, date_2
);
1240 for ( uint32_t skeletonIndex
= 0;
1241 skeletonIndex
< ARRAY_SIZE(skeleton
);
1243 const UnicodeString
& oneSkeleton
= skeleton
[skeletonIndex
];
1244 DateIntervalFormat
* dtitvfmt
= DateIntervalFormat::createInstance(oneSkeleton
, loc
, ec
);
1245 if (!assertSuccess("createInstance(skeleton)", ec
)) return;
1247 // reset the calendar to be Gregorian calendar for "th"
1248 if ( uprv_strcmp(locName, "th") == 0 ) {
1249 GregorianCalendar* gregCal = new GregorianCalendar(loc, ec);
1250 if (!assertSuccess("GregorianCalendar()", ec)) return;
1251 const DateFormat* dformat = dtitvfmt->getDateFormat();
1252 DateFormat* newOne = (DateFormat*)dformat->clone();
1253 newOne->adoptCalendar(gregCal);
1254 //dtitvfmt->adoptDateFormat(newOne, ec);
1255 dtitvfmt->setDateFormat(*newOne, ec);
1257 if (!assertSuccess("adoptDateFormat()", ec)) return;
1260 FieldPosition pos
=0;
1261 dtitvfmt
->format(&dtitv
, str
.remove(), pos
, ec
);
1262 if (!assertSuccess("format", ec
)) return;
1263 #ifdef DTIFMTTS_DEBUG
1264 oneSkeleton
.extract(0, oneSkeleton
.length(), result
, "UTF-8");
1265 sprintf(mesg
, "interval by skeleton: %s\n", result
);
1267 str
.extract(0, str
.length(), result
, "UTF-8");
1268 sprintf(mesg
, "interval date: %s\n", result
);
1274 // test user created DateIntervalInfo
1276 DateIntervalInfo
* dtitvinf
= new DateIntervalInfo(ec
);
1277 dtitvinf
->setFallbackIntervalPattern("{0} --- {1}", ec
);
1278 dtitvinf
->setIntervalPattern(UDAT_YEAR_ABBR_MONTH_DAY
, UCAL_MONTH
, "yyyy MMM d - MMM y",ec
);
1279 if (!assertSuccess("DateIntervalInfo::setIntervalPattern", ec
)) return;
1280 dtitvinf
->setIntervalPattern(UDAT_YEAR_ABBR_MONTH_DAY
, UCAL_HOUR_OF_DAY
, "yyyy MMM d HH:mm - HH:mm", ec
);
1281 if (!assertSuccess("DateIntervalInfo::setIntervalPattern", ec
)) return;
1282 DateIntervalFormat
* dtitvfmt
= DateIntervalFormat::createInstance(UDAT_YEAR_ABBR_MONTH_DAY
, loc
, *dtitvinf
, ec
);
1284 if (!assertSuccess("createInstance(skeleton,dtitvinf)", ec
)) return;
1285 FieldPosition pos
=0;
1286 dtitvfmt
->format(&dtitv
, str
.remove(), pos
, ec
);
1287 if ( uprv_strcmp(locName
, "th") ) {
1288 if (!assertSuccess("format", ec
)) return;
1289 #ifdef DTIFMTTS_DEBUG
1290 PRINTMESG("interval format using user defined DateIntervalInfo\n");
1291 str
.extract(0, str
.length(), result
, "UTF-8");
1292 sprintf(mesg
, "interval date: %s\n", result
);
1296 // for "th", the default calendar is Budhist,
1298 assertTrue("Default calendar for \"th\" is Budhist", ec
== U_ILLEGAL_ARGUMENT_ERROR
);
1305 #endif /* #if !UCONFIG_NO_FORMATTING */