Skip to content

Commit 4400589

Browse files
committed
[Test] Reproduce success() task-flow bug when chaining with different Error types.
1 parent b3a7d34 commit 4400589

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

SwiftTaskTests/MultipleErrorTypesTests.swift

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,4 +83,31 @@ class MultipleErrorTypesTests: _TestCase
8383

8484
self.wait()
8585
}
86+
87+
func testMultipleErrorTypes_success()
88+
{
89+
var expect = self.expectationWithDescription(__FUNCTION__)
90+
91+
self._task1(success: true)
92+
.success { value -> Task2 in
93+
94+
println("task1.success")
95+
self.flow += [3]
96+
97+
return self._task2(success: true)
98+
99+
}
100+
.success { value -> Void in
101+
102+
println("task1.success.success (task2 should end at this point)")
103+
self.flow += [6]
104+
105+
XCTAssertEqual(self.flow, Array(1...6), "Tasks should flow in order from 1 to 6.")
106+
expect.fulfill()
107+
108+
}
109+
110+
self.wait()
111+
}
112+
86113
}

0 commit comments

Comments
 (0)