Skip to content

Instantly share code, notes, and snippets.

@justin
Last active August 29, 2015 13:56
Show Gist options
  • Save justin/8886432 to your computer and use it in GitHub Desktop.
Save justin/8886432 to your computer and use it in GitHub Desktop.
Another NSRegularExpression test
#import <XCTest/XCTest.h>
#import "RSFoundationExtras.h"
@interface RSFoundationExtrasTests : XCTestCase
@end
@implementation RSFoundationExtrasTests
- (void)testExtractingLinksFromAPostWithMarkdownLinkSyntax
{
// jww: 02/08/14
// As of iOS 7.1b5 if you have two URLs wrapped in markdown link syntax
// and try to run it through Gruber's URL detection regex, it will deadlock.
// http://daringfireball.net/2010/07/improved_regex_for_matching_urls
NSString *markdownPost = @"[http://daringfireball.net](http://carpeaqua.com)";
XCTAssertEqual([[markdownPost rs_links] count], (unsigned long)2);
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment