Add test for anchors

X-SVN-Rev: 2305
This commit is contained in:
Alan Liu 2000-08-17 15:31:40 +00:00
parent e8d471a1dc
commit 2ccf765e0a
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/06/30 00:00:21 $
* $Revision: 1.24 $
* $Date: 2000/08/17 15:31:40 $
* $Revision: 1.25 $
*
*****************************************************************************************
*/
@ -375,6 +375,29 @@ public class TransliteratorTest extends TestFmwk {
}
}
/**
* Test anchors
*/
public void TestAnchors() {
expect("^ab > 01 ;" +
" ab > |8 ;" +
" b > k ;" +
" 8x$ > 45 ;" +
" 8x > 77 ;",
"ababbabxabx",
"018k7745");
expect("$s = [z$] ;" +
"$s{ab > 01 ;" +
" ab > |8 ;" +
" b > k ;" +
" 8x}$s > 45 ;" +
" 8x > 77 ;",
"abzababbabxzabxabx",
"01z018k45z01x45");
}
/**
* Test pattern quoting and escape mechanisms.
*/

View File

@ -5,8 +5,8 @@
*******************************************************************************
*
* $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/test/translit/Attic/TransliteratorTest.java,v $
* $Date: 2000/06/30 00:00:21 $
* $Revision: 1.24 $
* $Date: 2000/08/17 15:31:40 $
* $Revision: 1.25 $
*
*****************************************************************************************
*/
@ -375,6 +375,29 @@ public class TransliteratorTest extends TestFmwk {
}
}
/**
* Test anchors
*/
public void TestAnchors() {
expect("^ab > 01 ;" +
" ab > |8 ;" +
" b > k ;" +
" 8x$ > 45 ;" +
" 8x > 77 ;",
"ababbabxabx",
"018k7745");
expect("$s = [z$] ;" +
"$s{ab > 01 ;" +
" ab > |8 ;" +
" b > k ;" +
" 8x}$s > 45 ;" +
" 8x > 77 ;",
"abzababbabxzabxabx",
"01z018k45z01x45");
}
/**
* Test pattern quoting and escape mechanisms.
*/