diff options
Diffstat (limited to 'Foundation/GTMRegexTest.m')
-rw-r--r-- | Foundation/GTMRegexTest.m | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Foundation/GTMRegexTest.m b/Foundation/GTMRegexTest.m index 75f5aad..d43b731 100644 --- a/Foundation/GTMRegexTest.m +++ b/Foundation/GTMRegexTest.m @@ -885,6 +885,15 @@ XCTAssertNotNil(seg); XCTAssertGreaterThan([[seg description] length], (NSUInteger)10, @"failed to get a reasonable description for regex string segment"); + + // Truncation on the input string (and handling sort lengths) + enumerator = [regex segmentEnumeratorForString:@"aaabbbccc"]; + XCTAssertNotNil(enumerator); + XCTAssertTrue([[enumerator description] hasSuffix:@", string=\"aaabbbccc\" }"]); + enumerator = [regex segmentEnumeratorForString:@"aaabbbcccdddeeefffggghhh"]; + XCTAssertNotNil(enumerator); + XCTAssertTrue([[enumerator description] hasSuffix:@", string=\"aaabbbcccdddeeefffgg...\" }"]); + // regex w/ other options regex = [GTMRegex regexWithPattern:@"a+" options:(kGTMRegexOptionIgnoreCase | kGTMRegexOptionSupressNewlineSupport)]; |