aboutsummaryrefslogtreecommitdiffstats
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
parent26be35844939fac2adf3d1a024462f8262d51dd1 (diff)
downloadsequelpro-725df83787f10b0f6ff84c93de260a73577b1844.tar.gz
sequelpro-725df83787f10b0f6ff84c93de260a73577b1844.tar.bz2
sequelpro-725df83787f10b0f6ff84c93de260a73577b1844.zip
UUID string test.
-rw-r--r--Source/SPStringAdditions.m2
-rw-r--r--UnitTests/SPStringAdditionsTest.h1
-rw-r--r--UnitTests/SPStringAdditionsTest.m14
-rw-r--r--sequel-pro.xcodeproj/project.pbxproj4
4 files changed, 17 insertions, 4 deletions
diff --git a/Source/SPStringAdditions.m b/Source/SPStringAdditions.m
index 40a03e5c..84c5fa86 100644
--- a/Source/SPStringAdditions.m
+++ b/Source/SPStringAdditions.m
@@ -146,7 +146,7 @@
/**
* Returns a new created UUID string.
*/
-+ (NSString* )stringWithNewUUID
++ (NSString *)stringWithNewUUID
{
// Create a new UUID
CFUUIDRef uuidObj = CFUUIDCreate(nil);
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
diff --git a/sequel-pro.xcodeproj/project.pbxproj b/sequel-pro.xcodeproj/project.pbxproj
index 63b2d5b4..9fdeae15 100644
--- a/sequel-pro.xcodeproj/project.pbxproj
+++ b/sequel-pro.xcodeproj/project.pbxproj
@@ -33,6 +33,8 @@
17148565125F5FF500321285 /* SPDatabaseCharacterSets.m in Sources */ = {isa = PBXBuildFile; fileRef = 17148564125F5FF500321285 /* SPDatabaseCharacterSets.m */; };
1717F9661557E0450065C036 /* SPStringAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 1789343B0F30C1DD0097539A /* SPStringAdditions.m */; };
1717F9DB1558114D0065C036 /* OCMock.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 11D44DEF118F5887002AA43C /* OCMock.framework */; };
+ 1717FA401558313A0065C036 /* RegexKitLite.m in Sources */ = {isa = PBXBuildFile; fileRef = 296DC8AB0F909194002A3258 /* RegexKitLite.m */; };
+ 1717FA43155831600065C036 /* libicucore.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 296DC8BE0F9091DF002A3258 /* libicucore.dylib */; };
17292443107AC41000B21980 /* SPXMLExporter.m in Sources */ = {isa = PBXBuildFile; fileRef = 17292442107AC41000B21980 /* SPXMLExporter.m */; };
172A65110F7BED7A001E861A /* SPConsoleMessage.m in Sources */ = {isa = PBXBuildFile; fileRef = 172A65100F7BED7A001E861A /* SPConsoleMessage.m */; };
173284EA1088FEDE0062E892 /* SPConstants.m in Sources */ = {isa = PBXBuildFile; fileRef = 173284E91088FEDE0062E892 /* SPConstants.m */; };
@@ -1279,6 +1281,7 @@
buildActionMask = 2147483647;
files = (
1717F9DB1558114D0065C036 /* OCMock.framework in Frameworks */,
+ 1717FA43155831600065C036 /* libicucore.dylib in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -3069,6 +3072,7 @@
17DB5F441555CA300046834B /* SPMutableArrayAdditions.m in Sources */,
17DB5F4A1555CA810046834B /* SPMenuAdditions.m in Sources */,
1717F9661557E0450065C036 /* SPStringAdditions.m in Sources */,
+ 1717FA401558313A0065C036 /* RegexKitLite.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};