Skip to content

Commit

Permalink
ICU-13219 Add test for mark
Browse files Browse the repository at this point in the history
  • Loading branch information
FrankYFTang committed Nov 23, 2023
1 parent 503df57 commit 6868938
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 0 deletions.
33 changes: 33 additions & 0 deletions icu4c/source/test/intltest/rbbitst.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3929,6 +3929,23 @@ void RBBITest::TestDXLineBreaks()
assertEquals(WHERE, expected[i], actuals[i]);
}
}

bi->setText(UnicodeString(u"aaอออaaaaaอออ aaaa"));
c = bi->first();
actuals.clear();
do {
actuals.push_back(c);
} while ((c = bi->next()) != BreakIterator::DONE );
std::vector<int32_t> expected2{ 0, 17, 21 };
assertEquals(WHERE,
static_cast<int32_t>(expected2.size()),
static_cast<int32_t>(actuals.size()));
if (expected2.size() == actuals.size()) {
for (size_t i = 0; i < expected2.size(); i++) {
assertEquals(WHERE, expected2[i], actuals[i]);
}
}

#endif
}

Expand Down Expand Up @@ -3959,6 +3976,22 @@ void RBBITest::TestDXWordBreaks()
assertEquals(WHERE, expected[i], actuals[i]);
}
}

bi->setText(UnicodeString(u"aaอออaaaaaอออ aaaa"));
c = bi->first();
actuals.clear();
do {
actuals.push_back(c);
} while ((c = bi->next()) != BreakIterator::DONE );
std::vector<int32_t> expected2{ 0, 13, 17, 21 };
assertEquals(WHERE,
static_cast<int32_t>(expected2.size()),
static_cast<int32_t>(actuals.size()));
if (expected2.size() == actuals.size()) {
for (size_t i = 0; i < expected2.size(); i++) {
assertEquals(WHERE, expected2[i], actuals[i]);
}
}
#endif
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1017,6 +1017,15 @@ public void TestDXLineBreaks() {
actuals.add(c);
} while ((c = brk.next()) != BreakIterator.DONE);
assertEquals("-u-dx- is not working", expected, actuals);

brk.setText("aaอออaaaaaอออ aaaa");
actuals.clear();
expected = new ArrayList<Integer>(Arrays.asList(0, 17, 21));
c = brk.first();
do {
actuals.add(c);
} while ((c = brk.next()) != BreakIterator.DONE);
assertEquals("-u-dx- is not working", expected, actuals);
}
@Test
public void TestDXWordBreaks() {
Expand All @@ -1031,5 +1040,14 @@ public void TestDXWordBreaks() {
actuals.add(c);
} while ((c = brk.next()) != BreakIterator.DONE);
assertEquals("-u-dx- is not working", expected, actuals);

brk.setText("aaอออaaaaaอออ aaaa");
actuals.clear();
expected = new ArrayList<Integer>(Arrays.asList(0, 13, 17, 21));
c = brk.first();
do {
actuals.add(c);
} while ((c = brk.next()) != BreakIterator.DONE);
assertEquals("-u-dx- is not working", expected, actuals);
}
}

0 comments on commit 6868938

Please sign in to comment.