From 3f9fe159d05993fede4338135d48866133ef38b5 Mon Sep 17 00:00:00 2001 From: stuconnolly Date: Sat, 21 Jul 2012 05:37:48 +0000 Subject: QueryKit: Add test to check the explicit use of a database name in the query. --- Frameworks/QueryKit/Tests/QKSelectQueryTests.m | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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]; -- cgit v1.2.3