mirror of
https://github.com/groue/GRDB.swift
synced 2026-11-22 04:00:39 +00:00
More Swift 6 paranoid tests
This commit is contained in:
1 parent
aa28797f67
commit
dffc4bbe5d
3 files changed
+30
-3
No files matched your search
@@ -10,6 +10,15 @@ private class NonSendable {
|
||||
}
|
||||
|
||||
@Suite struct NonSendableTests {
|
||||
@Test func non_sendable_type_in_synchronous_database_access() throws {
|
||||
let dbQueue = try DatabaseQueue()
|
||||
let input = NonSendable(value: 0)
|
||||
let output = try dbQueue.read { _ in
|
||||
input
|
||||
}
|
||||
#expect(input === output)
|
||||
}
|
||||
|
||||
@Test func non_sendable_type_sent_to_databaseReader_read() async throws {
|
||||
let dbQueue = try DatabaseQueue()
|
||||
let nonSendable = NonSendable(value: 0)
|
||||
@@ -45,7 +54,7 @@ private class NonSendable {
|
||||
}
|
||||
#expect(value == 0)
|
||||
}
|
||||
|
||||
|
||||
@Test func non_sendable_type_sent_to_databaseWriter_writeWithoutTransaction() async throws {
|
||||
let dbQueue = try DatabaseQueue()
|
||||
let nonSendable = NonSendable(value: 0)
|
||||
|
||||
@@ -10,6 +10,15 @@ private class NonSendable {
|
||||
}
|
||||
|
||||
@Suite struct NonSendableTests {
|
||||
@Test func non_sendable_type_in_synchronous_database_access() throws {
|
||||
let dbQueue = try DatabaseQueue()
|
||||
let input = NonSendable(value: 0)
|
||||
let output = try dbQueue.read { _ in
|
||||
input
|
||||
}
|
||||
#expect(input === output)
|
||||
}
|
||||
|
||||
@Test func non_sendable_type_sent_to_databaseReader_read() async throws {
|
||||
let dbQueue = try DatabaseQueue()
|
||||
let nonSendable = NonSendable(value: 0)
|
||||
@@ -45,7 +54,7 @@ private class NonSendable {
|
||||
}
|
||||
#expect(value == 0)
|
||||
}
|
||||
|
||||
|
||||
@Test func non_sendable_type_sent_to_databaseWriter_writeWithoutTransaction() async throws {
|
||||
let dbQueue = try DatabaseQueue()
|
||||
let nonSendable = NonSendable(value: 0)
|
||||
|
||||
@@ -10,6 +10,15 @@ nonisolated private class NonSendable {
|
||||
}
|
||||
|
||||
@Suite struct NonSendableTests {
|
||||
@Test func non_sendable_type_in_synchronous_database_access() throws {
|
||||
let dbQueue = try DatabaseQueue()
|
||||
let input = NonSendable(value: 0)
|
||||
let output = try dbQueue.read { _ in
|
||||
input
|
||||
}
|
||||
#expect(input === output)
|
||||
}
|
||||
|
||||
@Test func non_sendable_type_sent_to_databaseReader_read() async throws {
|
||||
let dbQueue = try DatabaseQueue()
|
||||
let nonSendable = NonSendable(value: 0)
|
||||
@@ -45,7 +54,7 @@ nonisolated private class NonSendable {
|
||||
}
|
||||
#expect(value == 0)
|
||||
}
|
||||
|
||||
|
||||
@Test func non_sendable_type_sent_to_databaseWriter_writeWithoutTransaction() async throws {
|
||||
let dbQueue = try DatabaseQueue()
|
||||
let nonSendable = NonSendable(value: 0)
|
||||
|
||||
Reference in new issue
Block a user