diff --git a/Tests/GRDBTests/SQLInterpolationTests.swift b/Tests/GRDBTests/SQLInterpolationTests.swift index 457ca2586..27682d450 100644 --- a/Tests/GRDBTests/SQLInterpolationTests.swift +++ b/Tests/GRDBTests/SQLInterpolationTests.swift @@ -59,6 +59,7 @@ class SQLInterpolationTests: GRDBTestCase { let nilInteger: Int? = nil sql.appendInterpolation(a); sql.appendLiteral("\n") sql.appendInterpolation(a + 1); sql.appendLiteral("\n") + sql.appendInterpolation(2 * (a + 1)); sql.appendLiteral("\n") sql.appendInterpolation(a < b); sql.appendLiteral("\n") sql.appendInterpolation(integer); sql.appendLiteral("\n") sql.appendInterpolation(optionalInteger); sql.appendLiteral("\n") @@ -68,13 +69,14 @@ class SQLInterpolationTests: GRDBTestCase { XCTAssertEqual(sql.sql, """ "a" "a" + ? + ? * ("a" + ?) "a" < "b" ? ? NULL "a" IS NULL """) - XCTAssertEqual(sql.arguments, [1, 1, 2]) + XCTAssertEqual(sql.arguments, [1, 2, 1, 1, 2]) } func testQualifiedExpressionInterpolation() { diff --git a/Tests/GRDBTests/SQLLiteralTests.swift b/Tests/GRDBTests/SQLLiteralTests.swift index d2c350706..db10eb4f6 100644 --- a/Tests/GRDBTests/SQLLiteralTests.swift +++ b/Tests/GRDBTests/SQLLiteralTests.swift @@ -189,6 +189,7 @@ extension SQLLiteralTests { SELECT \(a), \(a + 1), + \(2 * (a + 1)), \(a < b), \(integer), \(optionalInteger), @@ -199,13 +200,14 @@ extension SQLLiteralTests { SELECT "a", "a" + ?, + ? * ("a" + ?), "a" < "b", ?, ?, NULL, "a" IS NULL """) - XCTAssertEqual(query.arguments, [1, 1, 2]) + XCTAssertEqual(query.arguments, [1, 2, 1, 1, 2]) } func testQualifiedExpressionInterpolation() {