aboutsummaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorMax <post@wickenrode.com>2015-04-23 21:34:15 +0200
committerMax <post@wickenrode.com>2015-04-23 21:34:15 +0200
commitd828290bdc4229db1beb7e8e2f9df0b8f0a35a72 (patch)
tree1551157fada5f09905379a1c08a6b57bc71ee816 /Source
parent5ef3f0df72d89ad85680a02048c27e2460e2c685 (diff)
downloadsequelpro-d828290bdc4229db1beb7e8e2f9df0b8f0a35a72.tar.gz
sequelpro-d828290bdc4229db1beb7e8e2f9df0b8f0a35a72.tar.bz2
sequelpro-d828290bdc4229db1beb7e8e2f9df0b8f0a35a72.zip
Added some basic unit tests for SPTableFilterParser
Diffstat (limited to 'Source')
-rw-r--r--Source/SPTableFilterParser.m12
1 files changed, 7 insertions, 5 deletions
diff --git a/Source/SPTableFilterParser.m b/Source/SPTableFilterParser.m
index 96ba8368..f7c9ed62 100644
--- a/Source/SPTableFilterParser.m
+++ b/Source/SPTableFilterParser.m
@@ -50,8 +50,10 @@
{
self = [super init];
if (self) {
- numberOfArguments = numArgs;
- _clause = [filter copy];
+ numberOfArguments = numArgs;
+ _clause = [filter copy];
+ caseSensitive = NO;
+ suppressLeadingTablePlaceholder = NO;
}
return self;
}
@@ -73,7 +75,7 @@
NSString *filterString;
// argument if Filter requires only one argument
- NSMutableString *argument = [[NSMutableString alloc] initWithString:_argument];
+ NSMutableString *argument = [[NSMutableString alloc] initWithString:(_argument? _argument : @"")];
// If the filter field is empty and the selected filter does not require
// only one argument, then no filtering is required - return nil.
@@ -83,8 +85,8 @@
}
// arguments if Filter requires two arguments
- NSMutableString *firstBetweenArgument = [[NSMutableString alloc] initWithString:_firstBetweenArgument];
- NSMutableString *secondBetweenArgument = [[NSMutableString alloc] initWithString:_secondBetweenArgument];
+ NSMutableString *firstBetweenArgument = [[NSMutableString alloc] initWithString:(_firstBetweenArgument? _firstBetweenArgument : @"")];
+ NSMutableString *secondBetweenArgument = [[NSMutableString alloc] initWithString:(_secondBetweenArgument? _secondBetweenArgument : @"")];
// If filter requires two arguments and either of the argument fields are empty
// return nil.