From b9854776c9ef65d3e00df04ee90df3b6e6d926b5 Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Thu, 30 Jun 2022 18:47:06 -0700 Subject: [PATCH] Fix a test which did not test what it intended to test --- RealmSwift/Tests/CombineTests.swift | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/RealmSwift/Tests/CombineTests.swift b/RealmSwift/Tests/CombineTests.swift index 04f19139a0..f5fa1b737d 100644 --- a/RealmSwift/Tests/CombineTests.swift +++ b/RealmSwift/Tests/CombineTests.swift @@ -111,6 +111,7 @@ class CombinePublisherTestCase: TestCase { override func setUp() { super.setUp() realm = try! Realm(configuration: Realm.Configuration(inMemoryIdentifier: "test")) + XCTAssertTrue(realm.isEmpty) } override func tearDown() { @@ -2775,9 +2776,7 @@ class CombineProjectionPublisherTests: CombinePublisherTestCase { class CombineAsyncRealmTests: CombinePublisherTestCase { func testWillChangeLocalWrite() { let asyncWriteExpectation = expectation(description: "Should complete async write") - cancellable = realm - .objectWillChange - .sink { + cancellable = realm.objectWillChange.sink { asyncWriteExpectation.fulfill() } @@ -2792,8 +2791,8 @@ class CombineAsyncRealmTests: CombinePublisherTestCase { cancellable = realm.objectWillChange.sink { exp.fulfill() } - DispatchQueue.main.async { - let realm = try! Realm(configuration: self.realm.configuration) + queue.async { + let realm = try! Realm(configuration: self.realm.configuration, queue: self.queue) realm.writeAsync { realm.create(SwiftIntObject.self, value: []) }