mirror of
https://github.com/groue/GRDB.swift
synced 2026-11-27 04:14:21 +00:00
Failing tests that exists() returns false when primary key is nil
This commit is contained in:
1 parent
ff5e171d4a
commit
e61550841b
3 files changed
+30
No files matched your search
@@ -394,6 +394,16 @@ class PrimaryKeyMultipleTests: GRDBTestCase {
|
||||
|
||||
// MARK: - Exists
|
||||
|
||||
func testExistsWithNilPrimaryKeyThatDoesNotMatchAnyRowReturnsFalse() {
|
||||
assertNoError {
|
||||
let dbQueue = try makeDatabaseQueue()
|
||||
dbQueue.inDatabase { db in
|
||||
let record = Citizenship(personName: nil, countryName: nil, native: true)
|
||||
XCTAssertFalse(record.exists(db))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func testExistsWithNotNilPrimaryKeyThatDoesNotMatchAnyRowReturnsFalse() {
|
||||
assertNoError {
|
||||
let dbQueue = try makeDatabaseQueue()
|
||||
|
||||
@@ -537,6 +537,16 @@ class PrimaryKeyRowIDTests: GRDBTestCase {
|
||||
|
||||
// MARK: - Exists
|
||||
|
||||
func testExistsWithNilPrimaryKeyReturnsFalse() {
|
||||
assertNoError {
|
||||
let dbQueue = try makeDatabaseQueue()
|
||||
dbQueue.inDatabase { db in
|
||||
let record = Person(id: nil, name: "Arthur")
|
||||
XCTAssertFalse(record.exists(db))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func testExistsWithNotNilPrimaryKeyThatDoesNotMatchAnyRowReturnsFalse() {
|
||||
assertNoError {
|
||||
let dbQueue = try makeDatabaseQueue()
|
||||
|
||||
@@ -459,6 +459,16 @@ class PrimaryKeySingleTests: GRDBTestCase {
|
||||
|
||||
// MARK: - Exists
|
||||
|
||||
func testExistsWithNilPrimaryKeyThatDoesNotMatchAnyRowReturnsFalse() {
|
||||
assertNoError {
|
||||
let dbQueue = try makeDatabaseQueue()
|
||||
dbQueue.inDatabase { db in
|
||||
let record = Pet(UUID: nil, name: "Bobby")
|
||||
XCTAssertFalse(record.exists(db))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func testExistsWithNotNilPrimaryKeyThatDoesNotMatchAnyRowReturnsFalse() {
|
||||
assertNoError {
|
||||
let dbQueue = try makeDatabaseQueue()
|
||||
|
||||
Reference in new issue
Block a user