aboutsummaryrefslogtreecommitdiffstats
path: root/UnitTests/SPStringAdditionsTest.m
diff options
context:
space:
mode:
Diffstat (limited to 'UnitTests/SPStringAdditionsTest.m')
-rw-r--r--UnitTests/SPStringAdditionsTest.m20
1 files changed, 18 insertions, 2 deletions
diff --git a/UnitTests/SPStringAdditionsTest.m b/UnitTests/SPStringAdditionsTest.m
index 0571ff3c..2d0cb0fb 100644
--- a/UnitTests/SPStringAdditionsTest.m
+++ b/UnitTests/SPStringAdditionsTest.m
@@ -34,8 +34,8 @@
*/
- (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 *SPASCIITestString = @"this is a big, crazy test st'ring with som'e random spaces and quot'es";
+ NSString *SPUTFTestString = @"In der Kürze liegt die Würz";
NSString *charsToRemove = @"abc',ü";
@@ -58,6 +58,9 @@
charsToRemove);
}
+/**
+ * stringWithNewUUID test case.
+ */
- (void)testStringWithNewUUID
{
NSString *uuid = [NSString stringWithNewUUID];
@@ -65,4 +68,17 @@
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);
}
+/**
+ * createViewSyntaxPrettifier test case.
+ */
+- (void)testCreateViewSyntaxPrettifier
+{
+ NSString *originalSyntax = @"CREATE VIEW `test_view` AS select `test_table`.`id` AS `id` from `test_table`;";
+ NSString *expectedSyntax = @"CREATE VIEW `test_view`\nAS SELECT\n `test_table`.`id` AS `id`\nFROM `test_table`;";
+
+ NSString *actualSyntax = [originalSyntax createViewSyntaxPrettifier];
+
+ STAssertEqualObjects([actualSyntax description], [expectedSyntax description], @"Actual view syntax '%@' does not equal expected syntax '%@'", actualSyntax, expectedSyntax);
+}
+
@end