From 2ff6980f65c1cb2d5dfd65a4ddd2ed2aa3096e4f Mon Sep 17 00:00:00 2001 From: Rachel Brindle Date: Mon, 14 Oct 2024 20:42:52 -0700 Subject: [PATCH] Fix build errors on xcode swift --- Tests/NimbleTests/PollingTest.swift | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Tests/NimbleTests/PollingTest.swift b/Tests/NimbleTests/PollingTest.swift index 616e411a..dbfd908f 100644 --- a/Tests/NimbleTests/PollingTest.swift +++ b/Tests/NimbleTests/PollingTest.swift @@ -155,12 +155,12 @@ final class PollingTest: XCTestCase { """ failsWithErrorMessage(msg) { // reference line waitUntil(timeout: .seconds(2)) { done in - var protected: Int = 0 + let protected = LockedContainer(0) DispatchQueue.main.async { - protected = 1 + protected.set(1) } - expect(protected).toEventually(equal(1)) + expect(protected.value).toEventually(equal(1)) done() } } @@ -215,29 +215,29 @@ final class PollingTest: XCTestCase { func testWaitUntilAllowsInBackgroundThread() { #if !SWIFT_PACKAGE - var executedAsyncBlock: Bool = false + let executedAsyncBlock = LockedContainer(false) let asyncOperation: () -> Void = { expect { waitUntil { done in done() } }.toNot(raiseException(named: "InvalidNimbleAPIUsage")) - executedAsyncBlock = true + executedAsyncBlock.set(true) } DispatchQueue.global().async(execute: asyncOperation) - expect(executedAsyncBlock).toEventually(beTruthy()) + expect(executedAsyncBlock.value).toEventually(beTruthy()) #endif } func testToEventuallyAllowsInBackgroundThread() { #if !SWIFT_PACKAGE - var executedAsyncBlock: Bool = false + let executedAsyncBlock = LockedContainer(false) let asyncOperation: () -> Void = { expect { expect(1).toEventually(equal(1)) }.toNot(raiseException(named: "InvalidNimbleAPIUsage")) - executedAsyncBlock = true + executedAsyncBlock.set(true) } DispatchQueue.global().async(execute: asyncOperation) - expect(executedAsyncBlock).toEventually(beTruthy()) + expect(executedAsyncBlock.value).toEventually(beTruthy()) #endif }