diff options
Diffstat (limited to 'UnitTests')
-rw-r--r-- | UnitTests/SPStringAdditionsTest.h | 1 | ||||
-rw-r--r-- | UnitTests/SPStringAdditionsTest.m | 14 |
2 files changed, 12 insertions, 3 deletions
diff --git a/UnitTests/SPStringAdditionsTest.h b/UnitTests/SPStringAdditionsTest.h index 786df76f..25d418f4 100644 --- a/UnitTests/SPStringAdditionsTest.h +++ b/UnitTests/SPStringAdditionsTest.h @@ -28,5 +28,6 @@ @interface SPStringAdditionsTest : SenTestCase - (void)testStringByRemovingCharactersInSet; +- (void)testStringWithNewUUID; @end diff --git a/UnitTests/SPStringAdditionsTest.m b/UnitTests/SPStringAdditionsTest.m index b0143a0f..0571ff3c 100644 --- a/UnitTests/SPStringAdditionsTest.m +++ b/UnitTests/SPStringAdditionsTest.m @@ -25,9 +25,7 @@ #import "SPStringAdditionsTest.h" #import "SPStringAdditions.h" - -static NSString *SPASCIITestString = @"this is a big, crazy test st'ring with som'e random spaces and quot'es"; -static NSString *SPUTFTestString = @"In der Kürze liegt die Würz"; +#import "RegexKitLite.h" @implementation SPStringAdditionsTest @@ -36,6 +34,9 @@ static NSString *SPUTFTestString = @"In der Kürze liegt die Würz"; */ - (void)testStringByRemovingCharactersInSet { + static NSString *SPASCIITestString = @"this is a big, crazy test st'ring with som'e random spaces and quot'es"; + static NSString *SPUTFTestString = @"In der Kürze liegt die Würz"; + NSString *charsToRemove = @"abc',ü"; NSCharacterSet *junk = [NSCharacterSet characterSetWithCharactersInString:charsToRemove]; @@ -57,4 +58,11 @@ static NSString *SPUTFTestString = @"In der Kürze liegt die Würz"; charsToRemove); } +- (void)testStringWithNewUUID +{ + NSString *uuid = [NSString stringWithNewUUID]; + + STAssertTrue([uuid isMatchedByRegex:@"[A-F0-9]{8}-[A-F0-9]{4}-[A-F0-9]{4}-[A-F0-9]{4}-[A-F0-9]{12}"], @"UUID %@ doesn't match regex", uuid); +} + @end |