ICU-1006 add tests for liberalized ID

X-SVN-Rev: 5040
This commit is contained in:
Alan Liu 2001-06-20 22:38:21 +00:00
parent 3d59e76f56
commit 7816fe3b3e
2 changed files with 32 additions and 0 deletions

View file

@ -58,6 +58,7 @@ TransliteratorTest::runIndexedTest(int32_t index, UBool exec,
TESTCASE(23,TestFilterIDs);
TESTCASE(24,TestCaseMap);
TESTCASE(25,TestNameMap);
TESTCASE(26,TestLiberalizedID);
default: name = ""; break;
}
}
@ -1007,6 +1008,31 @@ void TransliteratorTest::TestNameMap(void) {
delete name2uni;
}
/**
* Test liberalized ID syntax. 1006c
*/
void TransliteratorTest::TestLiberalizedID(void) {
const char* DATA[] = {
"latin-arabic", "case insensitivity",
" Null ", "whitespace",
" Latin[a-z]-Arabic ", "inline filter",
" null ; latin-arabic ", "compound whitespace",
};
const int32_t DATA_length = sizeof(DATA)/sizeof(DATA[0]);
for (int32_t i=0; i<DATA_length; i+=2) {
Transliterator *t = Transliterator::createInstance(DATA[i]);
if (t == 0) {
errln(UnicodeString("FAIL: ") + DATA[i+1] +
" test with ID \"" + DATA[i] + "\"");
} else {
logln(UnicodeString("Ok: ") + DATA[i+1] +
" test with ID \"" + DATA[i] + "\"");
delete t;
}
}
}
//======================================================================
// Support methods
//======================================================================

View file

@ -148,6 +148,12 @@ class TransliteratorTest : public IntlTest {
*/
void TestNameMap(void);
/**
* Test liberalized ID syntax. 1006c
*/
void TestLiberalizedID(void);
//======================================================================
// Support methods
//======================================================================