From fa62a27d1fea6f8671a6c021d792433d64fc8d8f Mon Sep 17 00:00:00 2001 From: Max Date: Thu, 15 Oct 2015 00:58:32 +0200 Subject: Add validation of SSL client cert file --- UnitTests/SPDataAdditionsTests.m | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'UnitTests') diff --git a/UnitTests/SPDataAdditionsTests.m b/UnitTests/SPDataAdditionsTests.m index c7a03f7f..988267d2 100644 --- a/UnitTests/SPDataAdditionsTests.m +++ b/UnitTests/SPDataAdditionsTests.m @@ -371,6 +371,17 @@ }]; STAssertTrue(invocations==2, @"other line breaks when only CRLF is expected"); } + //stopping early + { + const char inp[] = "Two\nLines\n"; + __block NSUInteger invocations = 0; + NSData *data = [NSData dataWithBytes:inp length:strlen(inp)]; + [data enumerateLinesBreakingAt:SPLineTerminatorAny withBlock:^(NSRange line, BOOL *stop) { + invocations++; + *stop = YES; + }]; + STAssertTrue(invocations==1, @"File with two lines, stopped after first"); + } } @end -- cgit v1.2.3