From 7bead0b2fc2dc203157988460c4c0a2abd5857a2 Mon Sep 17 00:00:00 2001 From: stuconnolly Date: Tue, 8 May 2012 14:40:57 +0000 Subject: Rename test files. --- UnitTests/SPMutableArrayAdditionsTest.h | 37 -------------- UnitTests/SPMutableArrayAdditionsTest.m | 41 ---------------- UnitTests/SPMutableArrayAdditionsTests.h | 37 ++++++++++++++ UnitTests/SPMutableArrayAdditionsTests.m | 44 +++++++++++++++++ UnitTests/SPStringAdditionsTest.h | 34 ------------- UnitTests/SPStringAdditionsTest.m | 84 -------------------------------- UnitTests/SPStringAdditionsTests.h | 34 +++++++++++++ UnitTests/SPStringAdditionsTests.m | 84 ++++++++++++++++++++++++++++++++ 8 files changed, 199 insertions(+), 196 deletions(-) delete mode 100644 UnitTests/SPMutableArrayAdditionsTest.h delete mode 100644 UnitTests/SPMutableArrayAdditionsTest.m create mode 100644 UnitTests/SPMutableArrayAdditionsTests.h create mode 100644 UnitTests/SPMutableArrayAdditionsTests.m delete mode 100644 UnitTests/SPStringAdditionsTest.h delete mode 100644 UnitTests/SPStringAdditionsTest.m create mode 100644 UnitTests/SPStringAdditionsTests.h create mode 100644 UnitTests/SPStringAdditionsTests.m (limited to 'UnitTests') diff --git a/UnitTests/SPMutableArrayAdditionsTest.h b/UnitTests/SPMutableArrayAdditionsTest.h deleted file mode 100644 index a7665a27..00000000 --- a/UnitTests/SPMutableArrayAdditionsTest.h +++ /dev/null @@ -1,37 +0,0 @@ -// -// $Id$ -// -// SPMutableArrayAdditionsTest.h -// sequel-pro -// -// Created by Stuart Connolly (stuconnolly.com) on February 2, 2011 -// Copyright (c) 2011 Stuart Connolly. All rights reserved. -// -// This program is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either version 2 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// More info at - -#import - -/** - * @class SPMutableArrayAdditionsTest SPMutableArrayAdditionsTest.h - * - * @author Stuart Connolly http://stuconnolly.com/ - * - * SPMutableArrayAdditions tests class. - */ -@interface SPMutableArrayAdditionsTest : SenTestCase - -@end diff --git a/UnitTests/SPMutableArrayAdditionsTest.m b/UnitTests/SPMutableArrayAdditionsTest.m deleted file mode 100644 index 4f265b34..00000000 --- a/UnitTests/SPMutableArrayAdditionsTest.m +++ /dev/null @@ -1,41 +0,0 @@ -// -// $Id$ -// -// SPMutableArrayAdditionsTest.m -// sequel-pro -// -// Created by Stuart Connolly (stuconnolly.com) on February 2, 2011 -// Copyright (c) 2011 Stuart Connolly. All rights reserved. -// -// This program is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either version 2 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// More info at - -#import "SPMutableArrayAdditionsTest.h" -#import "SPMutableArrayAdditions.h" - -@implementation SPMutableArrayAdditionsTest - -- (void)testReverse -{ - NSMutableArray *testArray = [NSMutableArray arrayWithObjects:@"1", @"2", @"3", @"4", @"5", nil]; - NSMutableArray *expectedArray = [NSMutableArray arrayWithObjects:@"5", @"4", @"3", @"2", @"1", nil]; - - [testArray reverse]; - - STAssertEqualObjects(testArray, expectedArray, @"The reversed array should look like: %@", expectedArray); -} - -@end diff --git a/UnitTests/SPMutableArrayAdditionsTests.h b/UnitTests/SPMutableArrayAdditionsTests.h new file mode 100644 index 00000000..bb94a734 --- /dev/null +++ b/UnitTests/SPMutableArrayAdditionsTests.h @@ -0,0 +1,37 @@ +// +// $Id$ +// +// SPMutableArrayAdditionsTests.h +// sequel-pro +// +// Created by Stuart Connolly (stuconnolly.com) on February 2, 2011 +// Copyright (c) 2011 Stuart Connolly. All rights reserved. +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// More info at + +#import + +/** + * @class SPMutableArrayAdditionsTest SPMutableArrayAdditionsTest.h + * + * @author Stuart Connolly http://stuconnolly.com/ + * + * SPMutableArrayAdditions tests class. + */ +@interface SPMutableArrayAdditionsTests : SenTestCase + +@end diff --git a/UnitTests/SPMutableArrayAdditionsTests.m b/UnitTests/SPMutableArrayAdditionsTests.m new file mode 100644 index 00000000..50ac0a90 --- /dev/null +++ b/UnitTests/SPMutableArrayAdditionsTests.m @@ -0,0 +1,44 @@ +// +// $Id$ +// +// SPMutableArrayAdditionsTests.m +// sequel-pro +// +// Created by Stuart Connolly (stuconnolly.com) on February 2, 2011 +// Copyright (c) 2011 Stuart Connolly. All rights reserved. +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// More info at + +#import "SPMutableArrayAdditionsTests.h" +#import "SPMutableArrayAdditions.h" + +@implementation SPMutableArrayAdditionsTests + +/** + * reverse test case. + */ +- (void)testReverse +{ + NSMutableArray *testArray = [NSMutableArray arrayWithObjects:@"1", @"2", @"3", @"4", @"5", nil]; + NSMutableArray *expectedArray = [NSMutableArray arrayWithObjects:@"5", @"4", @"3", @"2", @"1", nil]; + + [testArray reverse]; + + STAssertEqualObjects(testArray, expectedArray, @"The reversed array should look like: %@, but actually looks like: %@", expectedArray, testArray); +} + +@end diff --git a/UnitTests/SPStringAdditionsTest.h b/UnitTests/SPStringAdditionsTest.h deleted file mode 100644 index 9599b9a6..00000000 --- a/UnitTests/SPStringAdditionsTest.h +++ /dev/null @@ -1,34 +0,0 @@ -// -// $Id$ -// -// SPStringAdditionsTest.h -// sequel-pro -// -// Created by J Knight on 17/05/09. -// Copyright 2009 J Knight. All rights reserved. -// -// This program is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either version 2 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// More info at - -#import - -@interface SPStringAdditionsTest : SenTestCase - -- (void)testStringByRemovingCharactersInSet; -- (void)testStringWithNewUUID; -- (void)testCreateViewSyntaxPrettifier; - -@end diff --git a/UnitTests/SPStringAdditionsTest.m b/UnitTests/SPStringAdditionsTest.m deleted file mode 100644 index 2d0cb0fb..00000000 --- a/UnitTests/SPStringAdditionsTest.m +++ /dev/null @@ -1,84 +0,0 @@ -// -// $Id$ -// -// SPStringAdditionsTest.m -// sequel-pro -// -// Created by J Knight on 17/05/09. -// Copyright 2009 J Knight. All rights reserved. -// -// This program is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either version 2 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// More info at - -#import "SPStringAdditionsTest.h" -#import "SPStringAdditions.h" -#import "RegexKitLite.h" - -@implementation SPStringAdditionsTest - -/** - * stringByRemovingCharactersInSet test case. - */ -- (void)testStringByRemovingCharactersInSet -{ - 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',ü"; - - NSCharacterSet *junk = [NSCharacterSet characterSetWithCharactersInString:charsToRemove]; - - NSString *actualUTFString = SPUTFTestString; - NSString *actualASCIIString = SPASCIITestString; - - NSString *expectedUTFString = @"In der Krze liegt die Wrz"; - NSString *expectedASCIIString = @"this is ig rzy test string with some rndom spes nd quotes"; - - STAssertEqualObjects([actualASCIIString stringByRemovingCharactersInSet:junk], - expectedASCIIString, - @"The following characters should have been removed %@", - charsToRemove); - - STAssertEqualObjects([actualUTFString stringByRemovingCharactersInSet:junk], - expectedUTFString, - @"The following characters should have been removed %@", - charsToRemove); -} - -/** - * stringWithNewUUID test case. - */ -- (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); -} - -/** - * 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 diff --git a/UnitTests/SPStringAdditionsTests.h b/UnitTests/SPStringAdditionsTests.h new file mode 100644 index 00000000..1524e350 --- /dev/null +++ b/UnitTests/SPStringAdditionsTests.h @@ -0,0 +1,34 @@ +// +// $Id$ +// +// SPStringAdditionsTests.h +// sequel-pro +// +// Created by J Knight on 17/05/09. +// Copyright 2009 J Knight. All rights reserved. +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// More info at + +#import + +@interface SPStringAdditionsTests : SenTestCase + +- (void)testStringByRemovingCharactersInSet; +- (void)testStringWithNewUUID; +- (void)testCreateViewSyntaxPrettifier; + +@end diff --git a/UnitTests/SPStringAdditionsTests.m b/UnitTests/SPStringAdditionsTests.m new file mode 100644 index 00000000..2c2b2f25 --- /dev/null +++ b/UnitTests/SPStringAdditionsTests.m @@ -0,0 +1,84 @@ +// +// $Id$ +// +// SPStringAdditionsTests.m +// sequel-pro +// +// Created by J Knight on 17/05/09. +// Copyright 2009 J Knight. All rights reserved. +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// More info at + +#import "SPStringAdditionsTests.h" +#import "SPStringAdditions.h" +#import "RegexKitLite.h" + +@implementation SPStringAdditionsTests + +/** + * stringByRemovingCharactersInSet test case. + */ +- (void)testStringByRemovingCharactersInSet +{ + 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',ü"; + + NSCharacterSet *junk = [NSCharacterSet characterSetWithCharactersInString:charsToRemove]; + + NSString *actualUTFString = SPUTFTestString; + NSString *actualASCIIString = SPASCIITestString; + + NSString *expectedUTFString = @"In der Krze liegt die Wrz"; + NSString *expectedASCIIString = @"this is ig rzy test string with some rndom spes nd quotes"; + + STAssertEqualObjects([actualASCIIString stringByRemovingCharactersInSet:junk], + expectedASCIIString, + @"The following characters should have been removed %@", + charsToRemove); + + STAssertEqualObjects([actualUTFString stringByRemovingCharactersInSet:junk], + expectedUTFString, + @"The following characters should have been removed %@", + charsToRemove); +} + +/** + * stringWithNewUUID test case. + */ +- (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); +} + +/** + * 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 -- cgit v1.2.3