Skip to content

Commit 85fe7d1

Browse files
committed
🧪 Improve coverage of StateBinding.
1 parent 0f6f7e1 commit 85fe7d1

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

Tests/StateBindingTests/StateBindingTests.swift

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,10 @@ import XCTest
3030
class StateBindingTests: XCTestCase {
3131
func test_stateBinding_whenProvidedExternalBinding_doesUseExternalBinding() async {
3232
let getterExpectation = expectation(description: "Expected binding getter.")
33-
getterExpectation.expectedFulfillmentCount = 2
33+
getterExpectation.expectedFulfillmentCount = 3
3434

3535
let setterExpectation = expectation(description: "Expected binding setter.")
36+
setterExpectation.expectedFulfillmentCount = 2
3637

3738
let count = LockIsolated(0)
3839
let binding = Binding(
@@ -49,6 +50,10 @@ class StateBindingTests: XCTestCase {
4950
_counter.externalBinding = binding
5051
binding.wrappedValue = 10
5152
XCTAssertEqual(counter, 10)
52-
await fulfillment(of: [setterExpectation, getterExpectation], enforceOrder: true)
53+
54+
counter = 15
55+
XCTAssertEqual(counter, 15)
56+
57+
await fulfillment(of: [setterExpectation, getterExpectation], enforceOrder: false)
5358
}
5459
}

0 commit comments

Comments
 (0)