This commit is contained in:
Gwendal Roué committed 2020-07-05 16:23:19 +02:00
1 parent 68785d1c2d
commit 229fb36074
1 file changed
+6 -6
@@ -910,16 +910,16 @@ class QueryInterfaceRequestTests: GRDBTestCase {
XCTAssertEqual(lastSQLQuery, "SELECT MAX(\"id\") FROM \"readers\"")
}
do {
_ = try Row.fetchOne(db, tableRequest.select(min(Column("score")).forKey("minScore"), max(Column("score")).forKey("maxScore")))
XCTAssertEqual(lastSQLQuery, "SELECT MIN(\"score\") AS \"minScore\", MAX(\"score\") AS \"maxScore\" FROM \"readers\"")
_ = try Row.fetchOne(db, tableRequest.select(min(Column("age")).forKey("minAge"), max(Column("age")).forKey("maxAge")))
XCTAssertEqual(lastSQLQuery, "SELECT MIN(\"age\") AS \"minAge\", MAX(\"age\") AS \"maxAge\" FROM \"readers\"")
}
do {
_ = try Row.fetchOne(db, tableRequest.select(max(Column("score") + 1)))
XCTAssertEqual(lastSQLQuery, "SELECT MAX(\"score\" + 1) FROM \"readers\"")
_ = try Row.fetchOne(db, tableRequest.select(max(Column("age") + 1)))
XCTAssertEqual(lastSQLQuery, "SELECT MAX(\"age\" + 1) FROM \"readers\"")
}
do {
_ = try Row.fetchOne(db, tableRequest.select(max(Column("score")) + 1))
XCTAssertEqual(lastSQLQuery, "SELECT MAX(\"score\") + 1 FROM \"readers\"")
_ = try Row.fetchOne(db, tableRequest.select(max(Column("age")) + 1))
XCTAssertEqual(lastSQLQuery, "SELECT MAX(\"age\") + 1 FROM \"readers\"")
}
}
}