+// Bug 7029
+void RegexTest::Bug7029() {
+ UErrorCode status = U_ZERO_ERROR;
+
+ RegexMatcher* const pMatcher = new RegexMatcher(".", 0, status);
+ UnicodeString text = "abc.def";
+ UnicodeString splits[10];
+ REGEX_CHECK_STATUS;
+ int32_t numFields = pMatcher->split(text, splits, 10, status);
+ REGEX_CHECK_STATUS;
+ REGEX_ASSERT(numFields == 8);
+ delete pMatcher;
+}
+
+// Bug 9283
+// This test is checking for the existance of any supplemental characters that case-fold
+// to a bmp character.
+//
+// At the time of this writing there are none. If any should appear in a subsequent release
+// of Unicode, the code in regular expressions compilation that determines the longest
+// posssible match for a literal string will need to be enhanced.
+//
+// See file regexcmp.cpp, case URX_STRING_I in RegexCompile::maxMatchLength()
+// for details on what to do in case of a failure of this test.
+//
+void RegexTest::Bug9283() {
+ UErrorCode status = U_ZERO_ERROR;
+ UnicodeSet supplementalsWithCaseFolding("[[:CWCF:]&[\\U00010000-\\U0010FFFF]]", status);
+ REGEX_CHECK_STATUS;
+ int32_t index;
+ UChar32 c;
+ for (index=0; ; index++) {
+ c = supplementalsWithCaseFolding.charAt(index);
+ if (c == -1) {
+ break;
+ }
+ UnicodeString cf = UnicodeString(c).foldCase();
+ REGEX_ASSERT(cf.length() >= 2);
+ }
+}
+
+
+void RegexTest::CheckInvBufSize() {
+ if(inv_next>=INV_BUFSIZ) {
+ errln("%s: increase #define of INV_BUFSIZ ( is %d but needs to be at least %d )\n",
+ __FILE__, INV_BUFSIZ, inv_next);
+ } else {
+ logln("%s: INV_BUFSIZ is %d, usage %d\n", __FILE__, INV_BUFSIZ, inv_next);
+ }
+}
+