aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorstuconnolly <stuart02@gmail.com>2012-07-21 05:37:48 +0000
committerstuconnolly <stuart02@gmail.com>2012-07-21 05:37:48 +0000
commit3f9fe159d05993fede4338135d48866133ef38b5 (patch)
tree0bb2b52b7fe0256dc6ff94e13fdf2f84bfc26435
parent529192cd016e26805b84da4bb6701dc5096e0721 (diff)
downloadsequelpro-3f9fe159d05993fede4338135d48866133ef38b5.tar.gz
sequelpro-3f9fe159d05993fede4338135d48866133ef38b5.tar.bz2
sequelpro-3f9fe159d05993fede4338135d48866133ef38b5.zip
QueryKit: Add test to check the explicit use of a database name in the query.
-rw-r--r--Frameworks/QueryKit/Tests/QKSelectQueryTests.m11
1 files changed, 10 insertions, 1 deletions
diff --git a/Frameworks/QueryKit/Tests/QKSelectQueryTests.m b/Frameworks/QueryKit/Tests/QKSelectQueryTests.m
index 3eebb707..13b64458 100644
--- a/Frameworks/QueryKit/Tests/QKSelectQueryTests.m
+++ b/Frameworks/QueryKit/Tests/QKSelectQueryTests.m
@@ -94,7 +94,16 @@
STAssertTrue([[[self query] query] hasPrefix:query], nil);
}
-- (void)testSelectQueryMultipleFieldsWhenQuotedAreCorrect
+- (void)testSelectQueryFromDatabaseAndTableIsCorrect
+{
+ [[self query] setDatabase:QKTestDatabaseName];
+
+ NSString *query = [NSString stringWithFormat:@"FROM %1$@%2$@%1$@.%1$@%3$@%1$@", [self identifierQuote], QKTestDatabaseName, QKTestTableName];
+
+ STAssertTrue([[[self query] query] rangeOfString:query].location != NSNotFound, nil);
+}
+
+- (void)testSelectQueryMultipleFieldsAreCorrect
{
NSString *query = [NSString stringWithFormat:@"SELECT %1$@%2$@%1$@, %1$@%3$@%1$@, %1$@%4$@%1$@, %1$@%5$@%1$@", [self identifierQuote], QKTestFieldOne, QKTestFieldTwo, QKTestFieldThree, QKTestFieldFour];