Skip to content

Commit

Permalink
Added missing case for 100%
Browse files Browse the repository at this point in the history
  • Loading branch information
odrobnik committed Oct 21, 2013
1 parent c9b8474 commit d5bdc9b
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions Test/Source/NSScannerDTMarkdownTest.m
Expand Up @@ -173,4 +173,24 @@ - (void)testMissingSpacesAfterID
STAssertNil(ref, @"href should be nil");
}

- (void)testRefWithInvalidHyperlink
{
NSString *string = @"[foo]: ";

NSScanner *scanner = [NSScanner scannerWithString:string];
scanner.charactersToBeSkipped = nil;

NSString *href;
NSString *title;
NSString *ref;

BOOL b = [scanner scanMarkdownHyperlinkReferenceLine:&ref URLString:&href title:&title];

STAssertFalse(b, @"Should not be able to scan hyperlink");

STAssertNil(href, @"href should be nil");
STAssertNil(title, @"Title should be nil");
STAssertNil(ref, @"href should be nil");
}

@end

0 comments on commit d5bdc9b

Please sign in to comment.