ICU-11123 promote RegexMatcher::find(UErrorCode &) to public API

X-SVN-Rev: 37073
This commit is contained in:
Andy Heninger 2015-02-26 02:34:20 +00:00
parent 56459a99d9
commit d96fea9eb6
2 changed files with 10 additions and 1 deletions

View file

@ -849,7 +849,7 @@ public:
* position may not be valid with the altered input string.</p>
* @param status A reference to a UErrorCode to receive any errors.
* @return TRUE if a match is found.
* @internal
* @draft ICU 55
*/
virtual UBool find(UErrorCode &status);

View file

@ -4879,6 +4879,15 @@ void RegexTest::Callbacks() {
REGEX_ASSERT(matcher.matches(status)==FALSE);
REGEX_ASSERT(status == U_REGEX_STOPPED_BY_CALLER);
REGEX_ASSERT(cbInfo.numCalls == 4);
// A longer running find that the callback function will abort.
status = U_ZERO_ERROR;
cbInfo.reset(4);
s = "aaaaaaaaaaaaaaaaaaaaaaab";
matcher.reset(s);
REGEX_ASSERT(matcher.find(status)==FALSE);
REGEX_ASSERT(status == U_REGEX_STOPPED_BY_CALLER);
REGEX_ASSERT(cbInfo.numCalls == 4);
}