mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-08 15:05:53 +00:00
ICU-5340 Moved position of TransliteratorTest.TestAny() in the file after porting the test to C++, to keep the file organizations consistent.
X-SVN-Rev: 25822
This commit is contained in:
parent
b547d95cb0
commit
3503d74f28
1 changed files with 21 additions and 17 deletions
|
@ -2856,6 +2856,27 @@ public class TransliteratorTest extends TestFmwk {
|
|||
"greek:abkABK hiragana:abuku cyrillic:abc");
|
||||
}
|
||||
|
||||
/**
|
||||
* Test Any-X transliterators with sample letters from all scripts.
|
||||
*/
|
||||
public void TestAny() {
|
||||
UnicodeSet alphabetic = (UnicodeSet) new UnicodeSet("[:alphabetic:]").freeze();
|
||||
StringBuffer testString = new StringBuffer();
|
||||
for (int i = 0; i < UScript.CODE_LIMIT; ++i) {
|
||||
UnicodeSet sample = new UnicodeSet().applyPropertyAlias("script", UScript.getShortName(i)).retainAll(alphabetic);
|
||||
int count = 5;
|
||||
for (UnicodeSetIterator it = new UnicodeSetIterator(sample); it.next();) {
|
||||
testString.append(it.getString());
|
||||
if (--count < 0) break;
|
||||
}
|
||||
}
|
||||
logln("Sample set for Any-Latin: " + testString);
|
||||
Transliterator anyLatin = Transliterator.getInstance("any-Latn");
|
||||
String result = anyLatin.transliterate(testString.toString());
|
||||
logln("Sample result for Any-Latin: " + result);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Test the source and target set API. These are only implemented
|
||||
* for RBT and CompoundTransliterator at this time.
|
||||
|
@ -3374,23 +3395,6 @@ the ::BEGIN/::END stuff)
|
|||
logln("source = " + t.getSourceSet());
|
||||
logln("target = " + t.getTargetSet());
|
||||
}
|
||||
public void TestAny() {
|
||||
UnicodeSet alphabetic = (UnicodeSet) new UnicodeSet("[:alphabetic:]").freeze();
|
||||
StringBuffer testString = new StringBuffer();
|
||||
for (int i = 0; i < UScript.CODE_LIMIT; ++i) {
|
||||
UnicodeSet sample = new UnicodeSet().applyPropertyAlias("script", UScript.getShortName(i)).retainAll(alphabetic);
|
||||
int count = 5;
|
||||
for (UnicodeSetIterator it = new UnicodeSetIterator(sample); it.next();) {
|
||||
testString.append(it.getString());
|
||||
if (--count < 0) break;
|
||||
}
|
||||
}
|
||||
logln("Sample set for Any-Latin: " + testString);
|
||||
Transliterator anyLatin = Transliterator.getInstance("any-Latn");
|
||||
String result = anyLatin.transliterate(testString.toString());
|
||||
logln("Sample result for Any-Latin: " + result);
|
||||
}
|
||||
|
||||
/*
|
||||
* Test case for threading problem in NormalizationTransliterator
|
||||
* reported by ticket#5160
|
||||
|
|
Loading…
Add table
Reference in a new issue