From 5facc24ebbea034c8b390579d3fa110b23b22a52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Wed, 22 Mar 2023 18:40:37 +0100 Subject: [PATCH] Fix compiler warnings for Swift 5.8 --- Tests/GRDBTests/ValueObservationTests.swift | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/Tests/GRDBTests/ValueObservationTests.swift b/Tests/GRDBTests/ValueObservationTests.swift index 798b389e4..51570a3c5 100644 --- a/Tests/GRDBTests/ValueObservationTests.swift +++ b/Tests/GRDBTests/ValueObservationTests.swift @@ -782,7 +782,11 @@ class ValueObservationTests: GRDBTestCase { assertValueObservationRecordingMatch(recorded: counts, expected: [0, 1, 2]) // Observation was ended +#if compiler(>=5.8) + await fulfillment(of: [cancellationExpectation], timeout: 2) +#else wait(for: [cancellationExpectation], timeout: 2) +#endif } try await AsyncTest(test).run { try DatabaseQueue() } @@ -816,7 +820,11 @@ class ValueObservationTests: GRDBTestCase { assertValueObservationRecordingMatch(recorded: counts, expected: [0, 1, 2]) // Observation was ended +#if compiler(>=5.8) + await fulfillment(of: [cancellationExpectation], timeout: 2) +#else wait(for: [cancellationExpectation], timeout: 2) +#endif } try await AsyncTest(test).run { try DatabaseQueue() } @@ -854,7 +862,11 @@ class ValueObservationTests: GRDBTestCase { assertValueObservationRecordingMatch(recorded: counts, expected: [0, 1, 2]) // Observation was ended +#if compiler(>=5.8) + await fulfillment(of: [cancellationExpectation], timeout: 2) +#else wait(for: [cancellationExpectation], timeout: 2) +#endif } try await AsyncTest(test).run { try DatabaseQueue() } @@ -889,7 +901,11 @@ class ValueObservationTests: GRDBTestCase { assertValueObservationRecordingMatch(recorded: counts, expected: [0]) // Observation was ended +#if compiler(>=5.8) + await fulfillment(of: [cancellationExpectation], timeout: 2) +#else wait(for: [cancellationExpectation], timeout: 2) +#endif } try await AsyncTest(test).run { try DatabaseQueue() } @@ -936,7 +952,11 @@ class ValueObservationTests: GRDBTestCase { XCTAssertEqual(cancelledValue, "cancelled loop") // Make sure observation was cancelled as well +#if compiler(>=5.8) + await fulfillment(of: [cancellationExpectation], timeout: 2) +#else wait(for: [cancellationExpectation], timeout: 2) +#endif } try await AsyncTest(test).run { try DatabaseQueue() }