Skip to content

Commit dba2d97

Browse files
committed
Added testDoubleCancelInFlight Effect test.
1 parent 7cee1cc commit dba2d97

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

Tests/ComposableArchitectureTests/EffectTests.swift

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,17 @@ final class EffectTests: XCTestCase {
173173
XCTAssertNoDifference(isComplete, true)
174174
}
175175

176+
func testDoubleCancelInFlight() {
177+
var result: Int?
178+
179+
_ = Effect(value: 42)
180+
.cancellable(id: "id", cancelInFlight: true)
181+
.cancellable(id: "id", cancelInFlight: true)
182+
.startWithValues { result = $0 }
183+
184+
XCTAssertEqual(result, 42)
185+
}
186+
176187
#if canImport(_Concurrency) && compiler(>=5.5.2)
177188
func testTask() {
178189
#if os(Linux)

0 commit comments

Comments
 (0)