diff --git a/icu4j/src/com/ibm/icu/dev/test/search/SearchTest.java b/icu4j/src/com/ibm/icu/dev/test/search/SearchTest.java index 6a1b4b89f73..68907d5cf03 100755 --- a/icu4j/src/com/ibm/icu/dev/test/search/SearchTest.java +++ b/icu4j/src/com/ibm/icu/dev/test/search/SearchTest.java @@ -5,8 +5,8 @@ ******************************************************************************* * * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/icu/dev/test/search/SearchTest.java,v $ - * $Date: 2000/10/06 23:16:40 $ - * $Revision: 1.4 $ + * $Date: 2001/02/08 19:37:07 $ + * $Revision: 1.5 $ * ***************************************************************************************** */ @@ -460,4 +460,29 @@ public class SearchTest extends com.ibm.test.TestFmwk { f++; } } + + /** + * ICU4J Jitterbug 11 + */ + public void TestJ11() { + AuxJ11("c", "Scott Ganyo", 1); + AuxJ11(" ", "Scott Ganyo", 5); + } + + private void AuxJ11(String pattern, String text, int expectedLoc) { + try { + StringSearch ss = new StringSearch(pattern, text); + ss.setStrength(Collator.PRIMARY); + int loc = ss.next(); + if (loc == expectedLoc) { + logln("Ok: StringSearch(\"" + pattern + "\", \"" + text + "\") = " + loc); + } else { + errln("FAIL: StringSearch(\"" + pattern + "\", \"" + text + "\") = " + loc + + ", expected " + expectedLoc); + } + } catch (Exception e) { + errln("FAIL: StringSearch(\"" + pattern + "\", \"" + text + "\") threw "); + e.printStackTrace(); + } + } } diff --git a/icu4j/src/com/ibm/test/search/SearchTest.java b/icu4j/src/com/ibm/test/search/SearchTest.java index 2aa6c21024f..57f558f6cf3 100755 --- a/icu4j/src/com/ibm/test/search/SearchTest.java +++ b/icu4j/src/com/ibm/test/search/SearchTest.java @@ -5,8 +5,8 @@ ******************************************************************************* * * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/test/search/Attic/SearchTest.java,v $ - * $Date: 2000/10/06 23:16:40 $ - * $Revision: 1.4 $ + * $Date: 2001/02/08 19:37:07 $ + * $Revision: 1.5 $ * ***************************************************************************************** */ @@ -460,4 +460,29 @@ public class SearchTest extends com.ibm.test.TestFmwk { f++; } } + + /** + * ICU4J Jitterbug 11 + */ + public void TestJ11() { + AuxJ11("c", "Scott Ganyo", 1); + AuxJ11(" ", "Scott Ganyo", 5); + } + + private void AuxJ11(String pattern, String text, int expectedLoc) { + try { + StringSearch ss = new StringSearch(pattern, text); + ss.setStrength(Collator.PRIMARY); + int loc = ss.next(); + if (loc == expectedLoc) { + logln("Ok: StringSearch(\"" + pattern + "\", \"" + text + "\") = " + loc); + } else { + errln("FAIL: StringSearch(\"" + pattern + "\", \"" + text + "\") = " + loc + + ", expected " + expectedLoc); + } + } catch (Exception e) { + errln("FAIL: StringSearch(\"" + pattern + "\", \"" + text + "\") threw "); + e.printStackTrace(); + } + } }