private void doOtherInvariantTest(BreakIterator tb, String testChars) { StringBuffer work = new StringBuffer("a\r\na"); int errorCount = 0; // a break should never occur between CR and LF for (int i = 0; i < testChars.Length; i++) { work[0] = testChars[i]; for (int j = 0; j < testChars.Length; j++) { work[3] = testChars[j]; tb.SetText(work.ToString()); for (int k = tb.First(); k != BreakIterator.DONE; k = tb.Next()) { if (k == 2) { Errln("Break between CR and LF in string U+" + (work[0]).ToHexString() + ", U+d U+a U+" + (work[3]).ToHexString()); errorCount++; if (errorCount >= 75) { return; } } } } } // a break should never occur before a non-spacing mark, unless it's preceded // by a line terminator work.Length = (0); work.Append("aaaa"); for (int i = 0; i < testChars.Length; i++) { char c = testChars[i]; if (c == '\n' || c == '\r' || c == '\u2029' || c == '\u2028' || c == '\u0003') { continue; } work[1] = c; for (int j = 0; j < testChars.Length; j++) { c = testChars[j]; if (Character.GetType(c) != UnicodeCategory.NonSpacingMark && Character.GetType(c) != UnicodeCategory.EnclosingMark) { continue; } work[2] = c; tb.SetText(work.ToString()); for (int k = tb.First(); k != BreakIterator.DONE; k = tb.Next()) { if (k == 2) { Errln("Break between U+" + ((work[1])).ToHexString() + " and U+" + ((work[2])).ToHexString()); errorCount++; if (errorCount >= 75) { return; } } } } } }