mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-19 03:34:38 +00:00
ICU-10261 give DateFormat more granular leniency control (fix failing test on non-Windows platform)
X-SVN-Rev: 34329
This commit is contained in:
parent
e22e451cd8
commit
570986cb96
1 changed files with 4 additions and 4 deletions
|
@ -4209,11 +4209,11 @@ void DateFormatTest::TestDateFormatLeniency() {
|
|||
const TestDateFormatLeniencyItem items[] = {
|
||||
//locale leniency parse String pattern expected result
|
||||
{ "en", true, UnicodeString("2008-07 02"), UnicodeString("yyyy-LLLL dd"), UnicodeString("2008-July 02") },
|
||||
{ "en", false, UnicodeString("2008-07 02"), UnicodeString("yyyy-LLLL dd"), NULL },
|
||||
{ "en", false, UnicodeString("2008-07 02"), UnicodeString("yyyy-LLLL dd"), UnicodeString("") },
|
||||
{ "en", true, UnicodeString("2008-Jan 02"), UnicodeString("yyyy-LLL. dd"), UnicodeString("2008-Jan 02") },
|
||||
{ "en", false, UnicodeString("2008-Jan 02"), UnicodeString("yyyy-LLL. dd"), NULL },
|
||||
{ "en", false, UnicodeString("2008-Jan 02"), UnicodeString("yyyy-LLL. dd"), UnicodeString("") },
|
||||
{ "en", true, UnicodeString("2008-Jan--02"), UnicodeString("yyyy-MMM' -- 'dd"), UnicodeString("2008-Jan 02") },
|
||||
{ "en", false, UnicodeString("2008-Jan--02"), UnicodeString("yyyy-MMM' -- 'dd"), NULL },
|
||||
{ "en", false, UnicodeString("2008-Jan--02"), UnicodeString("yyyy-MMM' -- 'dd"), UnicodeString("") },
|
||||
// terminator
|
||||
{ NULL, true, UnicodeString(""), UnicodeString(""), UnicodeString("") }
|
||||
};
|
||||
|
@ -4235,7 +4235,7 @@ void DateFormatTest::TestDateFormatLeniency() {
|
|||
UDate d = sdmft->parse(itemPtr->parseString, pos);
|
||||
|
||||
if(pos.getErrorIndex() > -1)
|
||||
if(itemPtr->expectedResult != NULL) {
|
||||
if(itemPtr->expectedResult.length() != 0) {
|
||||
errln("error: unexpected error - " + itemPtr->parseString + " - error index " + pos.getErrorIndex() + " - leniency " + itemPtr->leniency);
|
||||
continue;
|
||||
} else
|
||||
|
|
Loading…
Add table
Reference in a new issue