Add support for cursor positioner '@'

X-SVN-Rev: 1219
This commit is contained in:
Alan Liu 2000-04-22 01:29:14 +00:00
parent 011d1e1344
commit 2af3ed4269
2 changed files with 50 additions and 4 deletions

View File

@ -5,8 +5,8 @@
*******************************************************************************
*
* $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/icu/dev/test/translit/TransliteratorTest.java,v $
* $Date: 2000/04/22 00:04:39 $
* $Revision: 1.16 $
* $Date: 2000/04/22 01:29:14 $
* $Revision: 1.17 $
*
*****************************************************************************************
*/
@ -431,6 +431,29 @@ public class TransliteratorTest extends TestFmwk {
}
}
/**
* Test cursor positioning outside of the key
*/
public void TestCursorOffset() {
// Array of 3n items
// Each item is <rules>, <input>, <expected output>
String[] DATA = {
"pre {alpha} post > | @ ALPHA ;" +
"eALPHA > beta ;" +
"pre {beta} post > BETA @@ | ;" +
"post > xyz",
"prealphapost prebetapost",
"prbetaxyz preBETApost",
};
for (int i=0; i<DATA.length; i+=3) {
logln("Pattern: " + Utility.escape(DATA[i]));
Transliterator t = new RuleBasedTransliterator("<ID>", DATA[i]);
expect(t, DATA[i+1], DATA[i+2]);
}
}
//======================================================================
// Support methods
//======================================================================

View File

@ -5,8 +5,8 @@
*******************************************************************************
*
* $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/test/translit/Attic/TransliteratorTest.java,v $
* $Date: 2000/04/22 00:04:39 $
* $Revision: 1.16 $
* $Date: 2000/04/22 01:29:14 $
* $Revision: 1.17 $
*
*****************************************************************************************
*/
@ -431,6 +431,29 @@ public class TransliteratorTest extends TestFmwk {
}
}
/**
* Test cursor positioning outside of the key
*/
public void TestCursorOffset() {
// Array of 3n items
// Each item is <rules>, <input>, <expected output>
String[] DATA = {
"pre {alpha} post > | @ ALPHA ;" +
"eALPHA > beta ;" +
"pre {beta} post > BETA @@ | ;" +
"post > xyz",
"prealphapost prebetapost",
"prbetaxyz preBETApost",
};
for (int i=0; i<DATA.length; i+=3) {
logln("Pattern: " + Utility.escape(DATA[i]));
Transliterator t = new RuleBasedTransliterator("<ID>", DATA[i]);
expect(t, DATA[i+1], DATA[i+2]);
}
}
//======================================================================
// Support methods
//======================================================================