mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-14 17:24:01 +00:00
ICU-3423 regex pattern clone test, work in progress.
X-SVN-Rev: 14248
This commit is contained in:
parent
8e2b360b6d
commit
108e25e702
1 changed files with 24 additions and 5 deletions
|
@ -1087,17 +1087,36 @@ void RegexTest::API_Pattern() {
|
|||
REGEX_ASSERT(*pat1c == *pat1);
|
||||
REGEX_ASSERT(*pat1c != *pat2);
|
||||
|
||||
|
||||
// TODO: Actually do some matches with the cloned/copied/assigned patterns.
|
||||
|
||||
|
||||
|
||||
delete pat1c;
|
||||
delete pat1a;
|
||||
delete pat1;
|
||||
delete pat2;
|
||||
|
||||
|
||||
//
|
||||
// Verify that a matcher created from a cloned pattern works.
|
||||
// (Jitterbug 3423)
|
||||
//
|
||||
#if 0
|
||||
{
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
RegexPattern *pSource = RegexPattern::compile("\\p{L}+", 0, status);
|
||||
RegexPattern *pClone = pSource->clone();
|
||||
delete pSource;
|
||||
RegexMatcher *mFromClone = pClone->matcher(status);
|
||||
REGEX_CHECK_STATUS;
|
||||
UnicodeString s = "Hello World";
|
||||
mFromClone->reset(s);
|
||||
REGEX_ASSERT(mFromClone->find() == TRUE);
|
||||
REGEX_ASSERT(mFromClone->group(status) == "Hello");
|
||||
REGEX_ASSERT(mFromClone->find() == TRUE);
|
||||
REGEX_ASSERT(mFromClone->group(status) == "World");
|
||||
REGEX_ASSERT(mFromClone->find() == FALSE);
|
||||
delete mFromClone;
|
||||
delete pClone;
|
||||
}
|
||||
#endif
|
||||
|
||||
//
|
||||
// matches convenience API
|
||||
//
|
||||
|
|
Loading…
Add table
Reference in a new issue