diff --git a/Tests/Swift6ApprochableConcurrencyGRDBTests/NonSendableTests.swift b/Tests/Swift6ApprochableConcurrencyGRDBTests/NonSendableTests.swift index 27b315605..9f41dbc80 100644 --- a/Tests/Swift6ApprochableConcurrencyGRDBTests/NonSendableTests.swift +++ b/Tests/Swift6ApprochableConcurrencyGRDBTests/NonSendableTests.swift @@ -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) diff --git a/Tests/Swift6DefaultGRDBTests/NonSendableTests.swift b/Tests/Swift6DefaultGRDBTests/NonSendableTests.swift index 27b315605..9f41dbc80 100644 --- a/Tests/Swift6DefaultGRDBTests/NonSendableTests.swift +++ b/Tests/Swift6DefaultGRDBTests/NonSendableTests.swift @@ -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) diff --git a/Tests/Swift6MainActorIsolationGRDBTests/NonSendableTests.swift b/Tests/Swift6MainActorIsolationGRDBTests/NonSendableTests.swift index b7c525f14..fddde57ea 100644 --- a/Tests/Swift6MainActorIsolationGRDBTests/NonSendableTests.swift +++ b/Tests/Swift6MainActorIsolationGRDBTests/NonSendableTests.swift @@ -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)