diff options
author | stuconnolly <stuart02@gmail.com> | 2011-01-27 20:38:23 +0000 |
---|---|---|
committer | stuconnolly <stuart02@gmail.com> | 2011-01-27 20:38:23 +0000 |
commit | 8db2f78294982e89fce5a162d92b2be6d9291aa1 (patch) | |
tree | b8dc7736f4af896aa3ed3fa9a96d1f3c4bfd0e59 /UnitTests/SPStringAdditionsTest.m | |
parent | fa7cff57548edc51420693e6909fe2adb3c18951 (diff) | |
parent | 7cc062247ff23496dd0390cf07b5d45d6bc49777 (diff) | |
download | sequelpro-8db2f78294982e89fce5a162d92b2be6d9291aa1.tar.gz sequelpro-8db2f78294982e89fce5a162d92b2be6d9291aa1.tar.bz2 sequelpro-8db2f78294982e89fce5a162d92b2be6d9291aa1.zip |
Bring outline view branch up to date with trunk (r3056:r3162).
Diffstat (limited to 'UnitTests/SPStringAdditionsTest.m')
-rw-r--r-- | UnitTests/SPStringAdditionsTest.m | 39 |
1 files changed, 21 insertions, 18 deletions
diff --git a/UnitTests/SPStringAdditionsTest.m b/UnitTests/SPStringAdditionsTest.m index 208381a8..8fce7e07 100644 --- a/UnitTests/SPStringAdditionsTest.m +++ b/UnitTests/SPStringAdditionsTest.m @@ -26,32 +26,35 @@ #import "SPStringAdditionsTest.h" #import "SPStringAdditions.h" -@implementation SPStringAdditionsTest - -- (void)setUp -{ - -} +static const NSString *SPASCIITestString = @"this is a big, crazy test st'ring with som'e random spaces and quot'es"; +static const NSString *SPUTFTestString = @"In der Kürze liegt die Würz"; -- (void)tearDown -{ - -} +@implementation SPStringAdditionsTest +/** + * stringByRemovingCharactersInSet test case. + */ - (void)testStringByRemovingCharactersInSet { - NSCharacterSet *junk = [NSCharacterSet characterSetWithCharactersInString:@"abc',ü"]; + NSString *charsToRemove = @"abc',ü"; + + NSCharacterSet *junk = [NSCharacterSet characterSetWithCharactersInString:charsToRemove]; - NSString *s = @"this is big, crazy st'ring"; - NSString *expect = @"this is ig rzy string"; + NSString *actualUTFString = SPUTFTestString; + NSString *actualASCIIString = SPASCIITestString; - STAssertEqualObjects([s stringByRemovingCharactersInSet:junk], expect, @"stringByRemovingCharactersInSet"); + NSString *expectedUTFString = @"In der Krze liegt die Wrz"; + NSString *expectedASCIIString = @"this is ig rzy test string with some rndom spes nd quotes"; - // Check UTF - s = @"In der Kürze liegt die Würz"; - expect = @"In der Krze liegt die Wrz"; + STAssertEqualObjects([actualASCIIString stringByRemovingCharactersInSet:junk], + expectedASCIIString, + @"The following characters should have been removed %@", + charsToRemove); - STAssertEqualObjects([s stringByRemovingCharactersInSet:junk], expect, @"stringByRemovingCharactersInSet"); + STAssertEqualObjects([actualUTFString stringByRemovingCharactersInSet:junk], + expectedUTFString, + @"The following characters should have been removed %@", + charsToRemove); } @end |