mirror of
https://github.com/groue/GRDB.swift
synced 2026-11-25 04:07:47 +00:00
Failing test for https://github.com/groue/GRDB.swift/issues/591
This commit is contained in:
1 parent
24c25dfd04
commit
d28847bf3d
2 files changed
+19
No files matched your search
@@ -104,6 +104,16 @@ class SQLInterpolationTests: GRDBTestCase {
|
||||
test(value: V(), isInterpolatedAs: "V".databaseValue)
|
||||
}
|
||||
|
||||
func testDataInterpolation() {
|
||||
// This test makes sure the Sequence conformance of Data does not
|
||||
// kick in.
|
||||
let data = "SQLite".data(using: .utf8)!
|
||||
var sql = SQLInterpolation(literalCapacity: 0, interpolationCount: 1)
|
||||
sql.appendInterpolation(data)
|
||||
XCTAssertEqual(sql.sql, "?")
|
||||
XCTAssertEqual(sql.arguments, [data])
|
||||
}
|
||||
|
||||
func testQualifiedExpressionInterpolation() {
|
||||
var sql = SQLInterpolation(literalCapacity: 0, interpolationCount: 1)
|
||||
|
||||
|
||||
@@ -234,6 +234,15 @@ extension SQLLiteralTests {
|
||||
test(value: V(), isInterpolatedAs: "V".databaseValue)
|
||||
}
|
||||
|
||||
func testDataInterpolation() {
|
||||
// This test makes sure the Sequence conformance of Data does not
|
||||
// kick in.
|
||||
let data = "SQLite".data(using: .utf8)!
|
||||
let query: SQLLiteral = "SELECT \(data)"
|
||||
XCTAssertEqual(query.sql, "SELECT ?")
|
||||
XCTAssertEqual(query.arguments, [data])
|
||||
}
|
||||
|
||||
func testQualifiedExpressionInterpolation() {
|
||||
let query: SQLLiteral = """
|
||||
SELECT \(Column("name").aliased("foo"))
|
||||
|
||||
Reference in new issue
Block a user