From 6da7d473947c1188efa40f9ce2f5eb249546c2f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Sun, 24 Jul 2022 13:34:45 +0200 Subject: [PATCH] Swift 5.7 required: Remove compiler checks --- GRDB/Core/DatabasePool.swift | 2 - GRDB/Core/DatabaseReader.swift | 2 - GRDB/Core/DatabaseRegion.swift | 2 - GRDB/Core/DatabaseValue.swift | 2 - GRDB/Core/DatabaseWriter.swift | 3 - GRDB/Core/Row.swift | 3 - GRDB/Core/SerializedDatabase.swift | 2 - .../Request/RequestProtocols.swift | 4 - GRDB/QueryInterface/SQL/Column.swift | 2 - GRDB/QueryInterface/SQL/SQLExpression.swift | 2 - .../SharedValueObservation.swift | 2 - GRDB/ValueObservation/ValueObservation.swift | 2 - Tests/GRDBCombineTests/Support.swift | 29 ---- ...sociationPrefetchingObservationTests.swift | 27 +--- Tests/GRDBTests/DatabaseReaderTests.swift | 7 +- .../DatabaseValueConversionTests.swift | 67 +------- Tests/GRDBTests/DatabaseWriterTests.swift | 12 -- Tests/GRDBTests/DerivableRequestTests.swift | 8 - Tests/GRDBTests/FTS3RecordTests.swift | 8 - Tests/GRDBTests/FTS4RecordTests.swift | 8 - Tests/GRDBTests/FTS5RecordTests.swift | 8 - Tests/GRDBTests/FailureTestCase.swift | 72 --------- Tests/GRDBTests/ForeignKeyInfoTests.swift | 13 +- .../FoundationDateComponentsTests.swift | 13 +- Tests/GRDBTests/FoundationDateTests.swift | 58 +------ Tests/GRDBTests/GRDBTestCase.swift | 71 +-------- .../RecordPrimaryKeyHiddenRowIDTests.swift | 8 - .../SharedValueObservationTests.swift | 2 - .../GRDBTests/ValueObservationRecorder.swift | 143 ++---------------- Tests/GRDBTests/ValueObservationTests.swift | 2 - 30 files changed, 35 insertions(+), 549 deletions(-) diff --git a/GRDB/Core/DatabasePool.swift b/GRDB/Core/DatabasePool.swift index 7b652e791..db11fd85a 100644 --- a/GRDB/Core/DatabasePool.swift +++ b/GRDB/Core/DatabasePool.swift @@ -158,10 +158,8 @@ public final class DatabasePool: DatabaseWriter { } } -#if swift(>=5.6) && canImport(_Concurrency) // @unchecked because of databaseSnapshotCount and readerPool extension DatabasePool: @unchecked Sendable { } -#endif extension DatabasePool { diff --git a/GRDB/Core/DatabaseReader.swift b/GRDB/Core/DatabaseReader.swift index f2719ab1f..b7abe63a1 100644 --- a/GRDB/Core/DatabaseReader.swift +++ b/GRDB/Core/DatabaseReader.swift @@ -371,7 +371,6 @@ extension DatabaseReader { } } -#if compiler(>=5.6) && canImport(_Concurrency) extension DatabaseReader { // MARK: - Asynchronous Database Access @@ -465,7 +464,6 @@ extension DatabaseReader { } } } -#endif #if canImport(Combine) extension DatabaseReader { diff --git a/GRDB/Core/DatabaseRegion.swift b/GRDB/Core/DatabaseRegion.swift index 0b2109089..0f134c4ce 100644 --- a/GRDB/Core/DatabaseRegion.swift +++ b/GRDB/Core/DatabaseRegion.swift @@ -356,13 +356,11 @@ public protocol DatabaseRegionConvertible { func databaseRegion(_ db: Database) throws -> DatabaseRegion } -#if compiler(>=5.5) extension DatabaseRegionConvertible where Self == DatabaseRegion { /// The region that covers the full database: all columns and all rows /// from all tables. public static var fullDatabase: Self { DatabaseRegion.fullDatabase } } -#endif extension DatabaseRegion: DatabaseRegionConvertible { /// :nodoc: diff --git a/GRDB/Core/DatabaseValue.swift b/GRDB/Core/DatabaseValue.swift index 86172505b..022a9106d 100644 --- a/GRDB/Core/DatabaseValue.swift +++ b/GRDB/Core/DatabaseValue.swift @@ -159,11 +159,9 @@ extension DatabaseValue: StatementBinding { extension DatabaseValue: Sendable { } -#if swift(>=5.6) && canImport(_Concurrency) // @unchecked due to Foundation.Data not conforming to Sendable // TODO: Remove @unchecked when Foundation has been upgraded extension DatabaseValue.Storage: @unchecked Sendable { } -#endif // MARK: - Hashable & Equatable diff --git a/GRDB/Core/DatabaseWriter.swift b/GRDB/Core/DatabaseWriter.swift index df7376e20..6b4a8a0ab 100644 --- a/GRDB/Core/DatabaseWriter.swift +++ b/GRDB/Core/DatabaseWriter.swift @@ -380,7 +380,6 @@ extension DatabaseWriter { } } -#if compiler(>=5.6) && canImport(_Concurrency) extension DatabaseWriter { // MARK: - Asynchronous Database Access @@ -491,8 +490,6 @@ extension DatabaseWriter { } } } -#endif - #if canImport(Combine) extension DatabaseWriter { diff --git a/GRDB/Core/Row.swift b/GRDB/Core/Row.swift index 5355a6f78..21c756b21 100644 --- a/GRDB/Core/Row.swift +++ b/GRDB/Core/Row.swift @@ -2182,12 +2182,9 @@ struct ArrayRowImpl: RowImpl { } } -#if swift(>=5.6) && canImport(_Concurrency) // @unchecked because columns property is not inferred as Sendable // TODO: remove this @unchecked when compiler can handle tuples. extension ArrayRowImpl: @unchecked Sendable { } -#endif - // TODO: merge with ArrayRowImpl eventually? /// See Row.init(copiedFromStatementRef:sqliteStatement:) diff --git a/GRDB/Core/SerializedDatabase.swift b/GRDB/Core/SerializedDatabase.swift index 0b261340a..0927f9fc1 100644 --- a/GRDB/Core/SerializedDatabase.swift +++ b/GRDB/Core/SerializedDatabase.swift @@ -249,9 +249,7 @@ final class SerializedDatabase { } } -#if swift(>=5.6) && canImport(_Concurrency) // @unchecked because the wrapped `Database` itself is not Sendable. // It happens the job of SerializedDatabase is precisely to provide thread-safe // access to `Database`. extension SerializedDatabase: @unchecked Sendable { } -#endif diff --git a/GRDB/QueryInterface/Request/RequestProtocols.swift b/GRDB/QueryInterface/Request/RequestProtocols.swift index 44df8aa24..90ef03457 100644 --- a/GRDB/QueryInterface/Request/RequestProtocols.swift +++ b/GRDB/QueryInterface/Request/RequestProtocols.swift @@ -459,11 +459,7 @@ extension TableRequest where Self: AggregatingRequest { return [Column(rowIDColumn)] } else if primaryKey.tableHasRowID { // Prefer the rowid - #if compiler(>=5.5) return [.rowID] - #else - return [Column.rowID] - #endif } else { // WITHOUT ROWID table: group by primary key columns return primaryKey.columns.map { Column($0) } diff --git a/GRDB/QueryInterface/SQL/Column.swift b/GRDB/QueryInterface/SQL/Column.swift index 4bb52256d..903cf7f7d 100644 --- a/GRDB/QueryInterface/SQL/Column.swift +++ b/GRDB/QueryInterface/SQL/Column.swift @@ -52,12 +52,10 @@ extension ColumnExpression { } } -#if compiler(>=5.5) extension ColumnExpression where Self == Column { /// The hidden rowID column public static var rowID: Self { Column.rowID } } -#endif /// A column in a database table. /// diff --git a/GRDB/QueryInterface/SQL/SQLExpression.swift b/GRDB/QueryInterface/SQL/SQLExpression.swift index a0fb30551..d65258e86 100644 --- a/GRDB/QueryInterface/SQL/SQLExpression.swift +++ b/GRDB/QueryInterface/SQL/SQLExpression.swift @@ -1667,12 +1667,10 @@ public protocol SQLExpressible { var sqlExpression: SQLExpression { get } } -#if compiler(>=5.5) extension SQLExpressible where Self == Column { /// The hidden rowID column public static var rowID: Self { Column.rowID } } -#endif /// `SQLSpecificExpressible` is a protocol for all database-specific types that /// can be turned into an SQL expression. Types whose existence is not purely diff --git a/GRDB/ValueObservation/SharedValueObservation.swift b/GRDB/ValueObservation/SharedValueObservation.swift index 8ef622ba9..8f0bd8ab3 100644 --- a/GRDB/ValueObservation/SharedValueObservation.swift +++ b/GRDB/ValueObservation/SharedValueObservation.swift @@ -299,7 +299,6 @@ public final class SharedValueObservation { } } -#if compiler(>=5.6) && canImport(_Concurrency) extension SharedValueObservation { // MARK: - Asynchronous Observation /// The database observation, as an asynchronous sequence of @@ -315,4 +314,3 @@ extension SharedValueObservation { } } } -#endif diff --git a/GRDB/ValueObservation/ValueObservation.swift b/GRDB/ValueObservation/ValueObservation.swift index bdfb58e3b..58a469288 100644 --- a/GRDB/ValueObservation/ValueObservation.swift +++ b/GRDB/ValueObservation/ValueObservation.swift @@ -252,7 +252,6 @@ extension ValueObservation: Refinable { } } -#if compiler(>=5.6) && canImport(_Concurrency) extension ValueObservation { // MARK: - Asynchronous Observation /// The database observation, as an asynchronous sequence of @@ -350,7 +349,6 @@ public struct AsyncValueObservation: AsyncSequence { } } } -#endif #if canImport(Combine) extension ValueObservation { diff --git a/Tests/GRDBCombineTests/Support.swift b/Tests/GRDBCombineTests/Support.swift index 88e194c50..89f315cf3 100644 --- a/Tests/GRDBCombineTests/Support.swift +++ b/Tests/GRDBCombineTests/Support.swift @@ -51,7 +51,6 @@ final class Test { } } -#if compiler(>=5.6) && canImport(_Concurrency) @available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) final class AsyncTest { // Raise the repeatCount in order to help spotting flaky tests. @@ -100,9 +99,7 @@ final class AsyncTest { } } } -#endif -#if compiler(>=5.3) @available(OSX 10.15, iOS 13, tvOS 13, watchOS 6, *) public func assertNoFailure( _ completion: Subscribers.Completion, @@ -127,31 +124,5 @@ public func assertFailure( XCTFail("Expected \(ExpectedFailure.self), got \(completion)", file: file, line: line) } } -#else -@available(OSX 10.15, iOS 13, tvOS 13, watchOS 6, *) -public func assertNoFailure( - _ completion: Subscribers.Completion, - file: StaticString = #file, - line: UInt = #line) -{ - if case let .failure(error) = completion { - XCTFail("Unexpected completion failure: \(error)", file: file, line: line) - } -} - -@available(OSX 10.15, iOS 13, tvOS 13, watchOS 6, *) -public func assertFailure( - _ completion: Subscribers.Completion, - file: StaticString = #file, - line: UInt = #line, - test: (ExpectedFailure) -> Void) -{ - if case let .failure(error) = completion, let expectedError = error as? ExpectedFailure { - test(expectedError) - } else { - XCTFail("Expected \(ExpectedFailure.self), got \(completion)", file: file, line: line) - } -} -#endif #endif diff --git a/Tests/GRDBTests/AssociationPrefetchingObservationTests.swift b/Tests/GRDBTests/AssociationPrefetchingObservationTests.swift index 7ea9a8095..8d850380e 100644 --- a/Tests/GRDBTests/AssociationPrefetchingObservationTests.swift +++ b/Tests/GRDBTests/AssociationPrefetchingObservationTests.swift @@ -9,11 +9,11 @@ private struct CompoundPrimaryKey: TableRecord { } private struct CompoundPrimaryKeyChild: TableRecord { } class AssociationPrefetchingObservationTests: GRDBTestCase { - private func _assertRequestRegionEqual( + private func assertRequestRegionEqual( _ db: Database, _ request: QueryInterfaceRequest, - _ expectedDescriptions: [String], - file: StaticString, line: UInt) throws + _ expectedDescriptions: String..., + file: StaticString = #filePath, line: UInt = #line) throws { // Test DatabaseRegionConvertible do { @@ -31,27 +31,6 @@ class AssociationPrefetchingObservationTests: GRDBTestCase { } } - // #file vs. #filePath dance - #if compiler(>=5.3) - private func assertRequestRegionEqual( - _ db: Database, - _ request: QueryInterfaceRequest, - _ expectedDescriptions: String..., - file: StaticString = #filePath, line: UInt = #line) throws - { - try _assertRequestRegionEqual(db, request, expectedDescriptions, file: file, line: line) - } - #else - private func assertRequestRegionEqual( - _ db: Database, - _ request: QueryInterfaceRequest, - _ expectedDescriptions: String..., - file: StaticString = #file, line: UInt = #line) throws - { - try _assertRequestRegionEqual(db, request, expectedDescriptions, file: file, line: line) - } - #endif - override func setup(_ dbWriter: DatabaseWriter) throws { try dbWriter.write { db in try db.create(table: "a") { t in diff --git a/Tests/GRDBTests/DatabaseReaderTests.swift b/Tests/GRDBTests/DatabaseReaderTests.swift index d16284f8a..674a5003c 100644 --- a/Tests/GRDBTests/DatabaseReaderTests.swift +++ b/Tests/GRDBTests/DatabaseReaderTests.swift @@ -30,7 +30,6 @@ class DatabaseReaderTests : GRDBTestCase { try test(setup(makeDatabasePool()).makeSnapshot()) } -#if compiler(>=5.6) && canImport(_Concurrency) @available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) func testAsyncAwait_ReadCanRead() async throws { func setup(_ dbWriter: T) throws -> T { @@ -50,7 +49,6 @@ class DatabaseReaderTests : GRDBTestCase { try await test(setup(makeDatabasePool())) try await test(setup(makeDatabasePool()).makeSnapshot()) } -#endif func testReadPreventsDatabaseModification() throws { func test(_ dbReader: DatabaseReader) throws { @@ -68,7 +66,6 @@ class DatabaseReaderTests : GRDBTestCase { try test(makeDatabasePool().makeSnapshot()) } -#if compiler(>=5.6) && canImport(_Concurrency) @available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) func testAsyncAwait_ReadPreventsDatabaseModification() async throws { func test(_ dbReader: DatabaseReader) async throws { @@ -85,7 +82,7 @@ class DatabaseReaderTests : GRDBTestCase { try await test(makeDatabasePool()) try await test(makeDatabasePool().makeSnapshot()) } -#endif + // MARK: - UnsafeRead func testUnsafeReadCanRead() throws { @@ -107,7 +104,6 @@ class DatabaseReaderTests : GRDBTestCase { try test(setup(makeDatabasePool()).makeSnapshot()) } -#if compiler(>=5.6) && canImport(_Concurrency) @available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) func testAsyncAwait_UnsafeReadCanRead() async throws { func setup(_ dbWriter: T) throws -> T { @@ -127,7 +123,6 @@ class DatabaseReaderTests : GRDBTestCase { try await test(setup(makeDatabasePool())) try await test(setup(makeDatabasePool()).makeSnapshot()) } -#endif // MARK: - UnsafeReentrantRead diff --git a/Tests/GRDBTests/DatabaseValueConversionTests.swift b/Tests/GRDBTests/DatabaseValueConversionTests.swift index 82c246cd0..9b1b091ee 100644 --- a/Tests/GRDBTests/DatabaseValueConversionTests.swift +++ b/Tests/GRDBTests/DatabaseValueConversionTests.swift @@ -34,14 +34,14 @@ private let jpegData = try! Data(contentsOf: Bundle(for: DatabaseValueConversion class DatabaseValueConversionTests : GRDBTestCase { - private func _assertDecoding( + private func assertDecoding( _ db: Database, _ sql: String, _ type: T.Type, expectedSQLiteConversion: T?, expectedDatabaseValueConversion: T?, - file: StaticString, - line: UInt) throws + file: StaticString = #filePath, + line: UInt = #line) throws { func stringRepresentation(_ value: T?) -> String { guard let value = value else { return "nil" } @@ -86,12 +86,12 @@ class DatabaseValueConversionTests : GRDBTestCase { } } - private func _assertFailedDecoding( + private func assertFailedDecoding( _ db: Database, _ sql: String, _ type: T.Type, - file: StaticString, - line: UInt) throws + file: StaticString = #filePath, + line: UInt = #line) throws { // We can only test failed decoding from database value, since // StatementColumnConvertible only supports optimistic decoding which @@ -100,61 +100,6 @@ class DatabaseValueConversionTests : GRDBTestCase { XCTAssertNil(T.fromDatabaseValue(dbValue), file: file, line: line) } - // #file vs. #filePath dance - #if compiler(>=5.3) - private func assertDecoding( - _ db: Database, - _ sql: String, - _ type: T.Type, - expectedSQLiteConversion: T?, - expectedDatabaseValueConversion: T?, - file: StaticString = #filePath, - line: UInt = #line) throws - { - try _assertDecoding( - db, sql, type, - expectedSQLiteConversion: expectedSQLiteConversion, - expectedDatabaseValueConversion: expectedDatabaseValueConversion, - file: file, line: line) - } - - private func assertFailedDecoding( - _ db: Database, - _ sql: String, - _ type: T.Type, - file: StaticString = #filePath, - line: UInt = #line) throws - { - try _assertFailedDecoding(db, sql, type, file: file, line: line) - } - #else - private func assertDecoding( - _ db: Database, - _ sql: String, - _ type: T.Type, - expectedSQLiteConversion: T?, - expectedDatabaseValueConversion: T?, - file: StaticString = #file, - line: UInt = #line) throws - { - try _assertDecoding( - db, sql, type, - expectedSQLiteConversion: expectedSQLiteConversion, - expectedDatabaseValueConversion: expectedDatabaseValueConversion, - file: file, line: line) - } - - private func assertFailedDecoding( - _ db: Database, - _ sql: String, - _ type: T.Type, - file: StaticString = #file, - line: UInt = #line) throws - { - try _assertFailedDecoding(db, sql, type, file: file, line: line) - } - #endif - // Datatypes In SQLite Version 3: https://www.sqlite.org/datatype3.html override func setup(_ dbWriter: DatabaseWriter) throws { diff --git a/Tests/GRDBTests/DatabaseWriterTests.swift b/Tests/GRDBTests/DatabaseWriterTests.swift index 5a7b4c433..0ff9e4081 100644 --- a/Tests/GRDBTests/DatabaseWriterTests.swift +++ b/Tests/GRDBTests/DatabaseWriterTests.swift @@ -266,7 +266,6 @@ class DatabaseWriterTests : GRDBTestCase { try DatabaseQueue().backup(to: dbQueue) } -#if compiler(>=5.6) && canImport(_Concurrency) @available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) func testAsyncAwait_write() async throws { func setup(_ dbWriter: T) throws -> T { @@ -286,9 +285,7 @@ class DatabaseWriterTests : GRDBTestCase { try await test(setup(makeDatabaseQueue())) try await test(setup(makeDatabasePool())) } -#endif -#if compiler(>=5.6) && canImport(_Concurrency) @available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) func testAsyncAwait_writeWithoutTransaction() async throws { func setup(_ dbWriter: T) throws -> T { @@ -311,9 +308,7 @@ class DatabaseWriterTests : GRDBTestCase { try await test(setup(makeDatabaseQueue())) try await test(setup(makeDatabasePool())) } -#endif -#if compiler(>=5.6) && canImport(_Concurrency) @available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) func testAsyncAwait_barrierWriteWithoutTransaction() async throws { func setup(_ dbWriter: T) throws -> T { @@ -336,9 +331,7 @@ class DatabaseWriterTests : GRDBTestCase { try await test(setup(makeDatabaseQueue())) try await test(setup(makeDatabasePool())) } -#endif -#if compiler(>=5.6) && canImport(_Concurrency) @available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) func testAsyncAwait_erase() async throws { func setup(_ dbWriter: T) throws -> T { @@ -356,9 +349,7 @@ class DatabaseWriterTests : GRDBTestCase { try await test(setup(makeDatabaseQueue())) try await test(setup(makeDatabasePool())) } -#endif -#if compiler(>=5.6) && canImport(_Concurrency) @available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) func testAsyncAwait_vacuum() async throws { func setup(_ dbWriter: T) throws -> T { @@ -374,9 +365,7 @@ class DatabaseWriterTests : GRDBTestCase { try await test(setup(makeDatabaseQueue())) try await test(setup(makeDatabasePool())) } -#endif -#if compiler(>=5.6) && canImport(_Concurrency) @available(macOS 10.16, iOS 14, tvOS 14, watchOS 7, *) // async + vacuum into func testAsyncAwait_vacuumInto() async throws { // Prevent SQLCipher failures @@ -406,5 +395,4 @@ class DatabaseWriterTests : GRDBTestCase { try await test(setup(makeDatabaseQueue())) try await test(setup(makeDatabasePool())) } -#endif } diff --git a/Tests/GRDBTests/DerivableRequestTests.swift b/Tests/GRDBTests/DerivableRequestTests.swift index 7d9c96cc2..6f3077f2c 100644 --- a/Tests/GRDBTests/DerivableRequestTests.swift +++ b/Tests/GRDBTests/DerivableRequestTests.swift @@ -25,17 +25,9 @@ private struct Book: FetchableRecord, PersistableRecord, Codable { static let databaseTableName = "book" static let author = belongsTo(Author.self) - #if compiler(>=5.5) static let bookFts4 = hasOne(BookFts4.self, using: ForeignKey([.rowID])) - #else - static let bookFts4 = hasOne(BookFts4.self, using: ForeignKey([Column.rowID])) - #endif #if SQLITE_ENABLE_FTS5 - #if compiler(>=5.5) static let bookFts5 = hasOne(BookFts5.self, using: ForeignKey([.rowID])) - #else - static let bookFts5 = hasOne(BookFts5.self, using: ForeignKey([Column.rowID])) - #endif #endif var author: QueryInterfaceRequest { request(for: Book.author) } diff --git a/Tests/GRDBTests/FTS3RecordTests.swift b/Tests/GRDBTests/FTS3RecordTests.swift index d7f3ff400..6f25c8aa0 100644 --- a/Tests/GRDBTests/FTS3RecordTests.swift +++ b/Tests/GRDBTests/FTS3RecordTests.swift @@ -10,11 +10,7 @@ private struct Book { extension Book : FetchableRecord { init(row: Row) { - #if compiler(>=5.5) id = row[.rowID] - #else - id = row[Column.rowID] - #endif title = row["title"] author = row["author"] body = row["body"] @@ -26,11 +22,7 @@ extension Book : MutablePersistableRecord { static let databaseSelection: [SQLSelectable] = [AllColumns(), Column.rowID] func encode(to container: inout PersistenceContainer) { - #if compiler(>=5.5) container[.rowID] = id - #else - container[Column.rowID] = id - #endif container["title"] = title container["author"] = author container["body"] = body diff --git a/Tests/GRDBTests/FTS4RecordTests.swift b/Tests/GRDBTests/FTS4RecordTests.swift index 8f322063b..34690bd73 100644 --- a/Tests/GRDBTests/FTS4RecordTests.swift +++ b/Tests/GRDBTests/FTS4RecordTests.swift @@ -10,11 +10,7 @@ private struct Book { extension Book : FetchableRecord { init(row: Row) { - #if compiler(>=5.5) id = row[.rowID] - #else - id = row[Column.rowID] - #endif title = row["title"] author = row["author"] body = row["body"] @@ -26,11 +22,7 @@ extension Book : MutablePersistableRecord { static let databaseSelection: [SQLSelectable] = [AllColumns(), Column.rowID] func encode(to container: inout PersistenceContainer) { - #if compiler(>=5.5) container[.rowID] = id - #else - container[Column.rowID] = id - #endif container["title"] = title container["author"] = author container["body"] = body diff --git a/Tests/GRDBTests/FTS5RecordTests.swift b/Tests/GRDBTests/FTS5RecordTests.swift index 2e23f03f4..c9068f829 100644 --- a/Tests/GRDBTests/FTS5RecordTests.swift +++ b/Tests/GRDBTests/FTS5RecordTests.swift @@ -11,11 +11,7 @@ private struct Book { extension Book : FetchableRecord { init(row: Row) { - #if compiler(>=5.5) id = row[.rowID] - #else - id = row[Column.rowID] - #endif title = row["title"] author = row["author"] body = row["body"] @@ -27,11 +23,7 @@ extension Book : MutablePersistableRecord { static let databaseSelection: [SQLSelectable] = [AllColumns(), Column.rowID] func encode(to container: inout PersistenceContainer) { - #if compiler(>=5.5) container[.rowID] = id - #else - container[Column.rowID] = id - #endif container["title"] = title container["author"] = author container["body"] = body diff --git a/Tests/GRDBTests/FailureTestCase.swift b/Tests/GRDBTests/FailureTestCase.swift index 2425b41e9..9dfb9770b 100644 --- a/Tests/GRDBTests/FailureTestCase.swift +++ b/Tests/GRDBTests/FailureTestCase.swift @@ -4,16 +4,8 @@ import XCTest /// A XCTestCase subclass that can test its own failures. class FailureTestCase: XCTestCase { private struct Failure: Hashable { - #if compiler(>=5.3) let issue: XCTIssue - #else - var description: String - var file: String - var line: Int - var expected: Bool - #endif - #if compiler(>=5.3) func issue(prefix: String = "") -> XCTIssue { if prefix.isEmpty { return issue @@ -27,22 +19,10 @@ class FailureTestCase: XCTestCase { attachments: issue.attachments) } } - #else - func failure(prefix: String = "") -> (description: String, file: String, line: Int, expected: Bool) { - let prefix = prefix.isEmpty ? "" : "\(prefix): " - return ( - description: prefix + description, - file: file, - line: line, - expected: expected) - } - #endif - #if compiler(>=5.3) private var description: String { return issue.compactDescription } - #endif func hash(into hasher: inout Hasher) { hasher.combine(0) @@ -60,7 +40,6 @@ class FailureTestCase: XCTestCase { let recordedFailures = try recordingFailures(execute) if prefixes.isEmpty { if recordedFailures.isEmpty { - #if compiler(>=5.3) record(XCTIssue( type: .assertionFailure, compactDescription: "No failure did happen", @@ -71,17 +50,9 @@ class FailureTestCase: XCTestCase { lineNumber: Int(line))), associatedError: nil, attachments: [])) - #else - recordFailure( - withDescription: "No failure did happen", - inFile: file.description, - atLine: Int(line), - expected: true) - #endif } } else { let expectedFailures = prefixes.map { prefix -> Failure in - #if compiler(>=5.3) return Failure(issue: XCTIssue( type: .assertionFailure, compactDescription: prefix, @@ -92,13 +63,6 @@ class FailureTestCase: XCTestCase { lineNumber: Int(line))), associatedError: nil, attachments: [])) - #else - return Failure( - description: prefix, - file: String(describing: file), - line: Int(line), - expected: true) - #endif } assertMatch( recordedFailures: recordedFailures, @@ -112,7 +76,6 @@ class FailureTestCase: XCTestCase { recordedFailures = [] } - #if compiler(>=5.3) override func record(_ issue: XCTIssue) { if isRecordingFailures { recordedFailures.append(Failure(issue: issue)) @@ -120,23 +83,6 @@ class FailureTestCase: XCTestCase { super.record(issue) } } - #else - override func recordFailure(withDescription description: String, inFile filePath: String, atLine lineNumber: Int, expected: Bool) { - if isRecordingFailures { - recordedFailures.append(Failure( - description: description, - file: filePath, - line: lineNumber, - expected: expected)) - } else { - super.recordFailure( - withDescription: description, - inFile: filePath, - atLine: lineNumber, - expected: expected) - } - } - #endif private func recordingFailures(_ execute: () throws -> Void) rethrows -> [Failure] { let oldRecordingFailures = isRecordingFailures @@ -161,16 +107,7 @@ class FailureTestCase: XCTestCase { if let index = expectedFailures.firstIndex(of: failure) { expectedFailures.remove(at: index) } else { - #if compiler(>=5.3) record(failure.issue()) - #else - let failure = failure.failure() - recordFailure( - withDescription: failure.description, - inFile: failure.file, - atLine: failure.line, - expected: failure.expected) - #endif } } @@ -179,16 +116,7 @@ class FailureTestCase: XCTestCase { if let index = recordedFailures.firstIndex(of: failure) { recordedFailures.remove(at: index) } else { - #if compiler(>=5.3) record(failure.issue(prefix: "Failure did not happen")) - #else - let failure = failure.failure(prefix: "Failure did not happen") - recordFailure( - withDescription: failure.description, - inFile: failure.file, - atLine: failure.line, - expected: failure.expected) - #endif } } } diff --git a/Tests/GRDBTests/ForeignKeyInfoTests.swift b/Tests/GRDBTests/ForeignKeyInfoTests.swift index 483db5179..f9b95d7d7 100644 --- a/Tests/GRDBTests/ForeignKeyInfoTests.swift +++ b/Tests/GRDBTests/ForeignKeyInfoTests.swift @@ -3,7 +3,7 @@ import XCTest class ForeignKeyInfoTests: GRDBTestCase { - private func _assertEqual(_ lhs: ForeignKeyInfo, _ rhs: ForeignKeyInfo, file: StaticString, line: UInt) { + private func assertEqual(_ lhs: ForeignKeyInfo, _ rhs: ForeignKeyInfo, file: StaticString = #filePath, line: UInt = #line) { XCTAssertEqual(lhs.destinationTable, rhs.destinationTable, file: file, line: line) XCTAssertEqual(lhs.mapping.count, rhs.mapping.count, file: file, line: line) for (larrow, rarrow) in zip(lhs.mapping, rhs.mapping) { @@ -12,17 +12,6 @@ class ForeignKeyInfoTests: GRDBTestCase { } } - // #file vs. #filePath dance - #if compiler(>=5.3) - private func assertEqual(_ lhs: ForeignKeyInfo, _ rhs: ForeignKeyInfo, file: StaticString = #filePath, line: UInt = #line) { - _assertEqual(lhs, rhs, file: file, line: line) - } - #else - private func assertEqual(_ lhs: ForeignKeyInfo, _ rhs: ForeignKeyInfo, file: StaticString = #file, line: UInt = #line) { - _assertEqual(lhs, rhs, file: file, line: line) - } - #endif - func testForeignKeys() throws { let dbQueue = try makeDatabaseQueue() try dbQueue.inDatabase { db in diff --git a/Tests/GRDBTests/FoundationDateComponentsTests.swift b/Tests/GRDBTests/FoundationDateComponentsTests.swift index 9a7b42801..4d16d0979 100644 --- a/Tests/GRDBTests/FoundationDateComponentsTests.swift +++ b/Tests/GRDBTests/FoundationDateComponentsTests.swift @@ -349,7 +349,7 @@ class FoundationDateComponentsTests : GRDBTestCase { } func testDatabaseDateComponentsParsing() { - func _assertParse(_ string: String, _ dateComponent: DatabaseDateComponents, file: StaticString, line: UInt) { + func assertParse(_ string: String, _ dateComponent: DatabaseDateComponents, file: StaticString = #filePath, line: UInt = #line) { do { // Test DatabaseValueConvertible adoption guard let parsed = DatabaseDateComponents.fromDatabaseValue(string.databaseValue) else { @@ -372,17 +372,6 @@ class FoundationDateComponentsTests : GRDBTestCase { } } - // #file vs. #filePath dance - #if compiler(>=5.3) - func assertParse(_ string: String, _ dateComponent: DatabaseDateComponents, file: StaticString = #filePath, line: UInt = #line) { - _assertParse(string, dateComponent, file: file, line: line) - } - #else - func assertParse(_ string: String, _ dateComponent: DatabaseDateComponents, file: StaticString = #file, line: UInt = #line) { - _assertParse(string, dateComponent, file: file, line: line) - } - #endif - assertParse( "0000-01-01", DatabaseDateComponents( diff --git a/Tests/GRDBTests/FoundationDateTests.swift b/Tests/GRDBTests/FoundationDateTests.swift index 63c7e2c80..16a1038b2 100644 --- a/Tests/GRDBTests/FoundationDateTests.swift +++ b/Tests/GRDBTests/FoundationDateTests.swift @@ -322,12 +322,12 @@ class FoundationDateTests : GRDBTestCase { return } - func _assert( + func assert( _ db: Database, _ expression: SQLExpression, equal expectedDate: Date, - file: StaticString, - line: UInt) throws + file: StaticString = #filePath, + line: UInt = #line) throws { let request: SQLRequest = "SELECT \(expression)" guard let shiftedDate = try request.fetchOne(db).flatMap(Date.init(julianDay:)) else { @@ -339,29 +339,6 @@ class FoundationDateTests : GRDBTestCase { XCTAssertEqual(shiftedInterval, expectedInterval, accuracy: 0.1, file: file, line: line) } - // #file vs. #filePath dance - #if compiler(>=5.3) - func assert( - _ db: Database, - _ expression: SQLExpression, - equal expectedDate: Date, - file: StaticString = #filePath, - line: UInt = #line) throws - { - try _assert(db, expression, equal: expectedDate, file: file, line: line) - } - #else - func assert( - _ db: Database, - _ expression: SQLExpression, - equal expectedDate: Date, - file: StaticString = #file, - line: UInt = #line) throws - { - try _assert(db, expression, equal: expectedDate, file: file, line: line) - } - #endif - let dbQueue = try makeDatabaseQueue() try dbQueue.inDatabase { db in let dbDate = date.databaseValue @@ -394,12 +371,12 @@ class FoundationDateTests : GRDBTestCase { return } - func _assert( + func assert( _ db: Database, _ expression: SQLExpression, equal expectedDate: String, - file: StaticString, - line: UInt) throws + file: StaticString = #filePath, + line: UInt = #line) throws { let request: SQLRequest = "SELECT \(expression)" guard let shiftedDate = try request.fetchOne(db) else { @@ -409,29 +386,6 @@ class FoundationDateTests : GRDBTestCase { XCTAssertEqual(shiftedDate, expectedDate, file: file, line: line) } - // #file vs. #filePath dance - #if compiler(>=5.3) - func assert( - _ db: Database, - _ expression: SQLExpression, - equal expectedDate: String, - file: StaticString = #filePath, - line: UInt = #line) throws - { - try _assert(db, expression, equal: expectedDate, file: file, line: line) - } - #else - func assert( - _ db: Database, - _ expression: SQLExpression, - equal expectedDate: String, - file: StaticString = #file, - line: UInt = #line) throws - { - try _assert(db, expression, equal: expectedDate, file: file, line: line) - } - #endif - let dbQueue = try makeDatabaseQueue() try dbQueue.inDatabase { db in let dbDate = date.databaseValue diff --git a/Tests/GRDBTests/GRDBTestCase.swift b/Tests/GRDBTests/GRDBTestCase.swift index 6c0d5b2e4..00f5b44f4 100644 --- a/Tests/GRDBTests/GRDBTestCase.swift +++ b/Tests/GRDBTests/GRDBTestCase.swift @@ -121,7 +121,7 @@ class GRDBTestCase: XCTestCase { do { try FileManager.default.removeItem(atPath: dbDirectoryPath) } catch { } } - private func _assertNoError(file: StaticString, line: UInt, _ test: () throws -> Void) { + func assertNoError(file: StaticString = #filePath, line: UInt = #line, _ test: () throws -> Void) { do { try test() } catch { @@ -129,93 +129,36 @@ class GRDBTestCase: XCTestCase { } } - private func _assertDidExecute(sql: String, file: StaticString, line: UInt) { + func assertDidExecute(sql: String, file: StaticString = #filePath, line: UInt = #line) { XCTAssertTrue(sqlQueries.contains(sql), "Did not execute \(sql)", file: file, line: line) } - private func _assert(_ record: EncodableRecord, isEncodedIn row: Row, file: StaticString, line: UInt) { + func assert(_ record: EncodableRecord, isEncodedIn row: Row, file: StaticString = #filePath, line: UInt = #line) { let recordDict = record.databaseDictionary let rowDict = Dictionary(row, uniquingKeysWith: { (left, _) in left }) XCTAssertEqual(recordDict, rowDict, file: file, line: line) } // Compare SQL strings (ignoring leading and trailing white space and semicolons. - private func _assertEqualSQL(_ lhs: String, _ rhs: String, file: StaticString, line: UInt) { + func assertEqualSQL(_ lhs: String, _ rhs: String, file: StaticString = #filePath, line: UInt = #line) { // Trim white space and ";" let cs = CharacterSet.whitespacesAndNewlines.union(CharacterSet(charactersIn: ";")) XCTAssertEqual(lhs.trimmingCharacters(in: cs), rhs.trimmingCharacters(in: cs), file: file, line: line) } // Compare SQL strings (ignoring leading and trailing white space and semicolons. - private func _assertEqualSQL(_ db: Database, _ request: Request, _ sql: String, file: StaticString, line: UInt) throws { + func assertEqualSQL(_ db: Database, _ request: Request, _ sql: String, file: StaticString = #filePath, line: UInt = #line) throws { try request.makeStatement(db).makeCursor().next() assertEqualSQL(lastSQLQuery!, sql, file: file, line: line) } // Compare SQL strings (ignoring leading and trailing white space and semicolons. - private func _assertEqualSQL(_ databaseReader: DatabaseReader, _ request: Request, _ sql: String, file: StaticString, line: UInt) throws { + func assertEqualSQL(_ databaseReader: DatabaseReader, _ request: Request, _ sql: String, file: StaticString = #filePath, line: UInt = #line) throws { try databaseReader.unsafeRead { db in try assertEqualSQL(db, request, sql, file: file, line: line) } } - // #file vs. #filePath dance - #if compiler(>=5.3) - func assertNoError(file: StaticString = #filePath, line: UInt = #line, _ test: () throws -> Void) { - _assertNoError(file: file, line: line, test) - } - - func assertDidExecute(sql: String, file: StaticString = #filePath, line: UInt = #line) { - _assertDidExecute(sql: sql, file: file, line: line) - } - - func assert(_ record: EncodableRecord, isEncodedIn row: Row, file: StaticString = #filePath, line: UInt = #line) { - _assert(record, isEncodedIn: row, file: file, line: line) - } - - // Compare SQL strings (ignoring leading and trailing white space and semicolons. - func assertEqualSQL(_ lhs: String, _ rhs: String, file: StaticString = #filePath, line: UInt = #line) { - _assertEqualSQL(lhs, rhs, file: file, line: line) - } - - // Compare SQL strings (ignoring leading and trailing white space and semicolons. - func assertEqualSQL(_ db: Database, _ request: Request, _ sql: String, file: StaticString = #filePath, line: UInt = #line) throws { - try _assertEqualSQL(db, request, sql, file: file, line: line) - } - - // Compare SQL strings (ignoring leading and trailing white space and semicolons. - func assertEqualSQL(_ databaseReader: DatabaseReader, _ request: Request, _ sql: String, file: StaticString = #filePath, line: UInt = #line) throws { - try _assertEqualSQL(databaseReader, request, sql, file: file, line: line) - } - #else - func assertNoError(file: StaticString = #file, line: UInt = #line, _ test: () throws -> Void) { - _assertNoError(file: file, line: line, test) - } - - func assertDidExecute(sql: String, file: StaticString = #file, line: UInt = #line) { - _assertDidExecute(sql: sql, file: file, line: line) - } - - func assert(_ record: EncodableRecord, isEncodedIn row: Row, file: StaticString = #file, line: UInt = #line) { - _assert(record, isEncodedIn: row, file: file, line: line) - } - - // Compare SQL strings (ignoring leading and trailing white space and semicolons. - func assertEqualSQL(_ lhs: String, _ rhs: String, file: StaticString = #file, line: UInt = #line) { - _assertEqualSQL(lhs, rhs, file: file, line: line) - } - - // Compare SQL strings (ignoring leading and trailing white space and semicolons. - func assertEqualSQL(_ db: Database, _ request: Request, _ sql: String, file: StaticString = #file, line: UInt = #line) throws { - try _assertEqualSQL(db, request, sql, file: file, line: line) - } - - // Compare SQL strings (ignoring leading and trailing white space and semicolons. - func assertEqualSQL(_ databaseReader: DatabaseReader, _ request: Request, _ sql: String, file: StaticString = #file, line: UInt = #line) throws { - try _assertEqualSQL(databaseReader, request, sql, file: file, line: line) - } - #endif - func sql(_ databaseReader: DatabaseReader, _ request: Request) -> String { try! databaseReader.unsafeRead { db in try request.makeStatement(db).makeCursor().next() @@ -259,7 +202,5 @@ public struct AnyValueReducer: ValueReducer { } } -#if swift(>=5.6) && canImport(_Concurrency) // Assume this is correct :-/ extension XCTestExpectation: @unchecked Sendable { } -#endif diff --git a/Tests/GRDBTests/RecordPrimaryKeyHiddenRowIDTests.swift b/Tests/GRDBTests/RecordPrimaryKeyHiddenRowIDTests.swift index e0dfba00d..97523ade9 100644 --- a/Tests/GRDBTests/RecordPrimaryKeyHiddenRowIDTests.swift +++ b/Tests/GRDBTests/RecordPrimaryKeyHiddenRowIDTests.swift @@ -36,11 +36,7 @@ private class Person : Record, Hashable { } required init(row: Row) { - #if compiler(>=5.5) id = row[.rowID] - #else - id = row[Column.rowID] - #endif age = row["age"] name = row["name"] creationDate = row["creationDate"] @@ -48,11 +44,7 @@ private class Person : Record, Hashable { } override func encode(to container: inout PersistenceContainer) { - #if compiler(>=5.5) container[.rowID] = id - #else - container[Column.rowID] = id - #endif container["name"] = name container["age"] = age container["creationDate"] = creationDate diff --git a/Tests/GRDBTests/SharedValueObservationTests.swift b/Tests/GRDBTests/SharedValueObservationTests.swift index 45610e39e..e510fc73e 100644 --- a/Tests/GRDBTests/SharedValueObservationTests.swift +++ b/Tests/GRDBTests/SharedValueObservationTests.swift @@ -621,7 +621,6 @@ class SharedValueObservationTests: GRDBTestCase { } #endif -#if compiler(>=5.6) && canImport(_Concurrency) @available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) func testAsyncAwait() async throws { let dbQueue = try makeDatabaseQueue() @@ -641,7 +640,6 @@ class SharedValueObservationTests: GRDBTestCase { break } } -#endif } private class Log: TextOutputStream { diff --git a/Tests/GRDBTests/ValueObservationRecorder.swift b/Tests/GRDBTests/ValueObservationRecorder.swift index 4db189940..9cfad00dc 100644 --- a/Tests/GRDBTests/ValueObservationRecorder.swift +++ b/Tests/GRDBTests/ValueObservationRecorder.swift @@ -283,8 +283,6 @@ extension XCTestCase { return try valueObservationExpectation.get() } - // #file vs. #filePath dance - #if compiler(>=5.3) /// This test checks the fundamental promise of ValueObservation by /// comparing recorded values with expected values. /// @@ -310,71 +308,13 @@ extension XCTestCase { /// - `[]` (missing last value) /// - `[0, 1, 2]` (unexpected value) /// - `[1, 0, 1]` (unexpected value) - public func assertValueObservationRecordingMatch( - recorded recordedValues: [Value], - expected expectedValues: [Value], + func assertValueObservationRecordingMatch( + recorded recordedValues: R, + expected expectedValues: E, + allowMissingLastValue: Bool = false, _ message: @autoclosure () -> String = "", file: StaticString = #filePath, line: UInt = #line) - where Value: Equatable - { - _assertValueObservationRecordingMatch( - recorded: recordedValues, - expected: expectedValues, - // Last value can't be missed - allowMissingLastValue: false, - message(), file: file, line: line) - } - #else - /// This test checks the fundamental promise of ValueObservation by - /// comparing recorded values with expected values. - /// - /// Recorded values match the expected values if and only if: - /// - /// - The last recorded value is the last expected value - /// - Recorded values are in the same order as expected values - /// - /// However, both missing and repeated values are allowed - with the only - /// exception of the last expected value which can not be missed. - /// - /// For example, if the expected values are [0, 1], then the following - /// recorded values match: - /// - /// - `[0, 1]` (identical values) - /// - `[1]` (missing value but the last one) - /// - `[0, 0, 1, 1]` (repeated value) - /// - /// However the following recorded values don't match, and fail the test: - /// - /// - `[1, 0]` (wrong order) - /// - `[0]` (missing last value) - /// - `[]` (missing last value) - /// - `[0, 1, 2]` (unexpected value) - /// - `[1, 0, 1]` (unexpected value) - public func assertValueObservationRecordingMatch( - recorded recordedValues: [Value], - expected expectedValues: [Value], - _ message: @autoclosure () -> String = "", - file: StaticString = #file, - line: UInt = #line) - where Value: Equatable - { - _assertValueObservationRecordingMatch( - recorded: recordedValues, - expected: expectedValues, - // Last value can't be missed - allowMissingLastValue: false, - message(), file: file, line: line) - } - #endif - - private func _assertValueObservationRecordingMatch( - recorded recordedValues: R, - expected expectedValues: E, - allowMissingLastValue: Bool, - _ message: @autoclosure () -> String = "", - file: StaticString, - line: UInt) where R: BidirectionalCollection, E: BidirectionalCollection, @@ -400,7 +340,7 @@ extension XCTestCase { let remainingRecordedValues = recordedValues.prefix(recordedValues.count - recordedSuffix.count) let remainingExpectedValues = expectedValues.prefix(expectedValues.count - expectedSuffix.count) - _assertValueObservationRecordingMatch( + assertValueObservationRecordingMatch( recorded: remainingRecordedValues, expected: remainingExpectedValues, // Other values can be missed @@ -412,13 +352,13 @@ extension XCTestCase { // MARK: - GRDBTestCase + ValueObservationExpectation extension GRDBTestCase { - func _assertValueObservation( + func assertValueObservation( _ observation: ValueObservation, records expectedValues: [Reducer.Value], setup: (Database) throws -> Void, recordedUpdates: @escaping (Database) throws -> Void, - file: StaticString, - line: UInt) + file: StaticString = #filePath, + line: UInt = #line) throws where Reducer.Value: Equatable { @@ -624,12 +564,12 @@ extension GRDBTestCase { } } - func _assertValueObservation( + func assertValueObservation( _ observation: ValueObservation, fails testFailure: (Failure, DatabaseWriter) throws -> Void, setup: (Database) throws -> Void, - file: StaticString, - line: UInt) + file: StaticString = #filePath, + line: UInt = #line) throws { func test( @@ -689,67 +629,6 @@ extension GRDBTestCase { testErrorDispatching: { XCTAssertNotNil(DispatchQueue.getSpecific(key: key)) }) } } - - // #file vs. #filePath dance - #if compiler(>=5.3) - func assertValueObservation( - _ observation: ValueObservation, - records expectedValues: [Reducer.Value], - setup: (Database) throws -> Void, - recordedUpdates: @escaping (Database) throws -> Void, - file: StaticString = #filePath, - line: UInt = #line) - throws - where Reducer.Value: Equatable - { - try _assertValueObservation( - observation, - records: expectedValues, - setup: setup, - recordedUpdates: recordedUpdates, - file: file, line: line) - } - - func assertValueObservation( - _ observation: ValueObservation, - fails testFailure: (Failure, DatabaseWriter) throws -> Void, - setup: (Database) throws -> Void, - file: StaticString = #filePath, - line: UInt = #line) - throws - { - try _assertValueObservation(observation, fails: testFailure, setup: setup, file: file, line: line) - } - #else - func assertValueObservation( - _ observation: ValueObservation, - records expectedValues: [Reducer.Value], - setup: (Database) throws -> Void, - recordedUpdates: @escaping (Database) throws -> Void, - file: StaticString = #file, - line: UInt = #line) - throws - where Reducer.Value: Equatable - { - try _assertValueObservation( - observation, - records: expectedValues, - setup: setup, - recordedUpdates: recordedUpdates, - file: file, line: line) - } - - func assertValueObservation( - _ observation: ValueObservation, - fails testFailure: (Failure, DatabaseWriter) throws -> Void, - setup: (Database) throws -> Void, - file: StaticString = #file, - line: UInt = #line) - throws - { - try _assertValueObservation(observation, fails: testFailure, setup: setup, file: file, line: line) - } - #endif } // MARK: - ValueObservationExpectations diff --git a/Tests/GRDBTests/ValueObservationTests.swift b/Tests/GRDBTests/ValueObservationTests.swift index b7252bb2a..7b9f14f8f 100644 --- a/Tests/GRDBTests/ValueObservationTests.swift +++ b/Tests/GRDBTests/ValueObservationTests.swift @@ -741,7 +741,6 @@ class ValueObservationTests: GRDBTestCase { try test(makeDatabasePool()) } -#if compiler(>=5.6) && canImport(_Concurrency) // MARK: - Async Await @available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) @@ -936,5 +935,4 @@ class ValueObservationTests: GRDBTestCase { .runAtTemporaryDatabasePath { try DatabaseQueue(path: $0) } .runAtTemporaryDatabasePath { try DatabasePool(path: $0) } } -#endif }