mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-18 11:14:22 +00:00
ICU-74 test locale-script mapping
X-SVN-Rev: 6509
This commit is contained in:
parent
236819b3b2
commit
836ea4b7e3
2 changed files with 62 additions and 40 deletions
|
@ -5,8 +5,8 @@
|
|||
*******************************************************************************
|
||||
*
|
||||
* $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/icu/dev/test/translit/TransliteratorTest.java,v $
|
||||
* $Date: 2001/10/30 18:08:19 $
|
||||
* $Revision: 1.58 $
|
||||
* $Date: 2001/10/31 01:17:06 $
|
||||
* $Revision: 1.59 $
|
||||
*
|
||||
*****************************************************************************************
|
||||
*/
|
||||
|
@ -1615,24 +1615,6 @@ public class TransliteratorTest extends TestFmwk {
|
|||
}
|
||||
}
|
||||
|
||||
//======================================================================
|
||||
// icu4j ONLY
|
||||
// These tests are not mirrored (yet) in icu4c at
|
||||
// source/test/intltest/transtst.cpp
|
||||
//======================================================================
|
||||
|
||||
/**
|
||||
* Test anchor masking
|
||||
*/
|
||||
public void TestAnchorMasking() {
|
||||
String rule = "^a > Q; a > q;";
|
||||
try {
|
||||
Transliterator t = Transliterator.createFromRules("ID", rule, Transliterator.FORWARD);
|
||||
} catch (IllegalArgumentException e) {
|
||||
errln("FAIL: " + rule + " => " + e);
|
||||
}
|
||||
}
|
||||
|
||||
//======================================================================
|
||||
// Ram's tests
|
||||
//======================================================================
|
||||
|
@ -1915,6 +1897,35 @@ public class TransliteratorTest extends TestFmwk {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test instantiation from a locale.
|
||||
*/
|
||||
public void TestLocaleInstantiation() {
|
||||
Transliterator t = Transliterator.getInstance("ru_RU-Latin");
|
||||
expect(t, "\u0430", "a");
|
||||
|
||||
t = Transliterator.getInstance("en-el");
|
||||
expect(t, "a", "\u1F00");
|
||||
}
|
||||
|
||||
//======================================================================
|
||||
// icu4j ONLY
|
||||
// These tests are not mirrored (yet) in icu4c at
|
||||
// source/test/intltest/transtst.cpp
|
||||
//======================================================================
|
||||
|
||||
/**
|
||||
* Test anchor masking
|
||||
*/
|
||||
public void TestAnchorMasking() {
|
||||
String rule = "^a > Q; a > q;";
|
||||
try {
|
||||
Transliterator t = Transliterator.createFromRules("ID", rule, Transliterator.FORWARD);
|
||||
} catch (IllegalArgumentException e) {
|
||||
errln("FAIL: " + rule + " => " + e);
|
||||
}
|
||||
}
|
||||
|
||||
//======================================================================
|
||||
// Support methods
|
||||
//======================================================================
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
*******************************************************************************
|
||||
*
|
||||
* $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/test/translit/Attic/TransliteratorTest.java,v $
|
||||
* $Date: 2001/10/30 18:08:19 $
|
||||
* $Revision: 1.58 $
|
||||
* $Date: 2001/10/31 01:17:06 $
|
||||
* $Revision: 1.59 $
|
||||
*
|
||||
*****************************************************************************************
|
||||
*/
|
||||
|
@ -1615,24 +1615,6 @@ public class TransliteratorTest extends TestFmwk {
|
|||
}
|
||||
}
|
||||
|
||||
//======================================================================
|
||||
// icu4j ONLY
|
||||
// These tests are not mirrored (yet) in icu4c at
|
||||
// source/test/intltest/transtst.cpp
|
||||
//======================================================================
|
||||
|
||||
/**
|
||||
* Test anchor masking
|
||||
*/
|
||||
public void TestAnchorMasking() {
|
||||
String rule = "^a > Q; a > q;";
|
||||
try {
|
||||
Transliterator t = Transliterator.createFromRules("ID", rule, Transliterator.FORWARD);
|
||||
} catch (IllegalArgumentException e) {
|
||||
errln("FAIL: " + rule + " => " + e);
|
||||
}
|
||||
}
|
||||
|
||||
//======================================================================
|
||||
// Ram's tests
|
||||
//======================================================================
|
||||
|
@ -1915,6 +1897,35 @@ public class TransliteratorTest extends TestFmwk {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test instantiation from a locale.
|
||||
*/
|
||||
public void TestLocaleInstantiation() {
|
||||
Transliterator t = Transliterator.getInstance("ru_RU-Latin");
|
||||
expect(t, "\u0430", "a");
|
||||
|
||||
t = Transliterator.getInstance("en-el");
|
||||
expect(t, "a", "\u1F00");
|
||||
}
|
||||
|
||||
//======================================================================
|
||||
// icu4j ONLY
|
||||
// These tests are not mirrored (yet) in icu4c at
|
||||
// source/test/intltest/transtst.cpp
|
||||
//======================================================================
|
||||
|
||||
/**
|
||||
* Test anchor masking
|
||||
*/
|
||||
public void TestAnchorMasking() {
|
||||
String rule = "^a > Q; a > q;";
|
||||
try {
|
||||
Transliterator t = Transliterator.createFromRules("ID", rule, Transliterator.FORWARD);
|
||||
} catch (IllegalArgumentException e) {
|
||||
errln("FAIL: " + rule + " => " + e);
|
||||
}
|
||||
}
|
||||
|
||||
//======================================================================
|
||||
// Support methods
|
||||
//======================================================================
|
||||
|
|
Loading…
Add table
Reference in a new issue