aboutsummaryrefslogtreecommitdiffstats
path: root/UnitTests
diff options
context:
space:
mode:
authorstuconnolly <stuart02@gmail.com>2012-05-07 16:38:40 +0000
committerstuconnolly <stuart02@gmail.com>2012-05-07 16:38:40 +0000
commit725df83787f10b0f6ff84c93de260a73577b1844 (patch)
tree2a5786f86491d0dc04216ff09c6fa96ac56a9480 /UnitTests
parent26be35844939fac2adf3d1a024462f8262d51dd1 (diff)
downloadsequelpro-725df83787f10b0f6ff84c93de260a73577b1844.tar.gz
sequelpro-725df83787f10b0f6ff84c93de260a73577b1844.tar.bz2
sequelpro-725df83787f10b0f6ff84c93de260a73577b1844.zip
UUID string test.
Diffstat (limited to 'UnitTests')
-rw-r--r--UnitTests/SPStringAdditionsTest.h1
-rw-r--r--UnitTests/SPStringAdditionsTest.m14
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