Failing test for #1383

This commit is contained in:
Gwendal Roué committed 2023-06-01 17:05:06 +02:00
1 parent 0a92a99223
commit d66d2118b5
1 file changed
+23
@@ -1152,4 +1152,27 @@ class ValueObservationTests: GRDBTestCase {
try Test(test).runAtTemporaryDatabasePath { try DatabasePool(path: $0) }
}
// Regression test for <https://github.com/groue/GRDB.swift/issues/1383>
func testIssue1383() throws {
do {
let dbPool = try makeDatabasePool(filename: "test")
try dbPool.writeWithoutTransaction { db in
try db.execute(sql: "CREATE TABLE t(a)")
try db.checkpoint(.truncate)
}
}
do {
let dbPool = try makeDatabasePool(filename: "test")
let observation = ValueObservation.tracking(Table("t").fetchCount)
_ = observation.start(
in: dbPool, scheduling: .immediate,
onError: { error in
XCTFail("Unexpected error \(error)")
},
onChange: { _ in
})
}
}
}