mirror of
https://github.com/groue/GRDB.swift
synced 2026-11-22 04:00:39 +00:00
Fix a warning in Version 27.0 beta
This commit is contained in:
1 parent
9ed8c8457e
commit
f1eb48b0cf
1 file changed
+14
-9
@@ -1016,18 +1016,23 @@ class ValueObservationTests: GRDBTestCase {
|
||||
return "cancelled loop"
|
||||
}
|
||||
|
||||
// Lanch the task that cancels
|
||||
// Launch the task that cancels
|
||||
Task {
|
||||
let observation = ValueObservation.trackingConstantRegion(Table("t").fetchCount)
|
||||
for try await count in observation.values(in: writer) {
|
||||
if count >= 3 {
|
||||
cancelledTask.cancel()
|
||||
break
|
||||
} else {
|
||||
try await writer.write {
|
||||
try $0.execute(sql: "INSERT INTO t DEFAULT VALUES")
|
||||
do {
|
||||
let observation = ValueObservation.trackingConstantRegion(Table("t").fetchCount)
|
||||
for try await count in observation.values(in: writer) {
|
||||
if count >= 3 {
|
||||
cancelledTask.cancel()
|
||||
break
|
||||
} else {
|
||||
try await writer.write {
|
||||
try $0.execute(sql: "INSERT INTO t DEFAULT VALUES")
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch {
|
||||
XCTFail("Unexpected error: \(error)")
|
||||
cancelledTask.cancel()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user