@@ -29,20 +29,20 @@ final class ConcurrencyTests: XCTestCase {
2929 var first = true
3030 var observedScreen : TestScreen ?
3131
32- let cancellable = host. rendering . sink { rendering in
32+ let cancellable = host. renderingPublisher . sink { rendering in
3333 if first {
3434 expectation. fulfill ( )
3535 first = false
3636 }
3737 observedScreen = rendering
3838 }
3939
40- let initialScreen = host. rendering. value
40+ let initialScreen = host. rendering
4141 XCTAssertEqual ( 0 , initialScreen. count)
4242 initialScreen. update ( )
4343
4444 // This update happens immediately as a new rendering is generated synchronously.
45- XCTAssertEqual ( 1 , host. rendering. value . count)
45+ XCTAssertEqual ( 1 , host. rendering. count)
4646
4747 wait ( for: [ expectation] , timeout: 1.0 )
4848 guard let screen = observedScreen else {
@@ -60,7 +60,7 @@ final class ConcurrencyTests: XCTestCase {
6060 let renderingExpectation = expectation ( description: " Waiting on rendering values. " )
6161 var first = true
6262
63- let cancellable = host. rendering . dropFirst ( ) . sink { rendering in
63+ let cancellable = host. renderingPublisher . dropFirst ( ) . sink { rendering in
6464 if first {
6565 first = false
6666 // Emit an event when the rendering is first received.
@@ -70,15 +70,15 @@ final class ConcurrencyTests: XCTestCase {
7070 }
7171 }
7272
73- let initialScreen = host. rendering. value
73+ let initialScreen = host. rendering
7474 XCTAssertEqual ( 0 , initialScreen. count)
7575
7676 // Updating the screen will cause two events - the `update` here, and the update caused by the first time the rendering changes.
7777 initialScreen. update ( )
7878
7979 waitForExpectations ( timeout: 1 )
8080
81- XCTAssertEqual ( 2 , host. rendering. value . count)
81+ XCTAssertEqual ( 2 , host. rendering. count)
8282 cancellable. cancel ( )
8383 }
8484
@@ -88,7 +88,7 @@ final class ConcurrencyTests: XCTestCase {
8888 let renderingExpectation = expectation ( description: " Waiting on rendering values. " )
8989 var renderingValuesCount = 0
9090
91- let cancellable = host. rendering . dropFirst ( ) . sink { rendering in
91+ let cancellable = host. renderingPublisher . dropFirst ( ) . sink { rendering in
9292 if renderingValuesCount == 0 {
9393 // Emit two events.
9494 rendering. update ( )
@@ -104,15 +104,15 @@ final class ConcurrencyTests: XCTestCase {
104104 renderingValuesCount += 1
105105 }
106106
107- let initialScreen = host. rendering. value
107+ let initialScreen = host. rendering
108108 XCTAssertEqual ( 0 , initialScreen. count)
109109
110110 // Updating the screen will cause three events.
111111 initialScreen. update ( )
112112
113113 waitForExpectations ( timeout: 1 )
114114
115- XCTAssertEqual ( 3 , host. rendering. value . count)
115+ XCTAssertEqual ( 3 , host. rendering. count)
116116 cancellable. cancel ( )
117117 }
118118
@@ -123,20 +123,20 @@ final class ConcurrencyTests: XCTestCase {
123123 let host = WorkflowHost ( workflow: TestWorkflow ( ) )
124124
125125 // Capture the initial screen and corresponding closure that uses the original sink.
126- let initialScreen = host. rendering. value
126+ let initialScreen = host. rendering
127127 XCTAssertEqual ( 0 , initialScreen. count)
128128
129129 // Send an action to the workflow. This invalidates this sink, but the next render pass declares a
130130 // sink of the same type.
131131 initialScreen. update ( )
132132
133- let secondScreen = host. rendering. value
133+ let secondScreen = host. rendering
134134 XCTAssertEqual ( 1 , secondScreen. count)
135135
136136 // Send an action from the original screen and sink. It should be proxied through the most recent sink.
137137 initialScreen. update ( )
138138
139- let thirdScreen = host. rendering. value
139+ let thirdScreen = host. rendering
140140 XCTAssertEqual ( 2 , thirdScreen. count)
141141 }
142142
@@ -146,14 +146,14 @@ final class ConcurrencyTests: XCTestCase {
146146 let host = WorkflowHost ( workflow: OneShotWorkflow ( ) )
147147
148148 // Capture the initial screen and corresponding closure that uses the original sink.
149- let initialScreen = host. rendering. value
149+ let initialScreen = host. rendering
150150 XCTAssertEqual ( 0 , initialScreen. count)
151151
152152 // Send an action to the workflow. This invalidates this sink, but the next render pass declares a
153153 // sink of the same type.
154154 initialScreen. update ( )
155155
156- let secondScreen = host. rendering. value
156+ let secondScreen = host. rendering
157157 XCTAssertEqual ( 1 , secondScreen. count)
158158
159159 // Calling `update` uses the original sink. Historically this would be expected
@@ -165,7 +165,7 @@ final class ConcurrencyTests: XCTestCase {
165165 // If the sink *was* still valid, this would be correct. However, it should just fail and be `1` still.
166166 // XCTAssertEqual(2, secondScreen.count)
167167 // Actual expected result, if we had not fatal errored.
168- XCTAssertEqual ( 1 , host. rendering. value . count)
168+ XCTAssertEqual ( 1 , host. rendering. count)
169169
170170 struct OneShotWorkflow : Workflow {
171171 typealias Output = Never
@@ -228,7 +228,7 @@ final class ConcurrencyTests: XCTestCase {
228228 var first = true
229229
230230 let renderingsComplete = expectation ( description: " Waiting for renderings " )
231- let cancellable = host. rendering . dropFirst ( ) . sink { rendering in
231+ let cancellable = host. renderingPublisher . dropFirst ( ) . sink { rendering in
232232 if first {
233233 first = false
234234 rendering. update ( )
@@ -237,7 +237,7 @@ final class ConcurrencyTests: XCTestCase {
237237 }
238238 }
239239
240- let initialScreen = host. rendering. value
240+ let initialScreen = host. rendering
241241 initialScreen. update ( )
242242
243243 waitForExpectations ( timeout: 1 )
@@ -251,14 +251,14 @@ final class ConcurrencyTests: XCTestCase {
251251 func test_childWorkflowsAreSynchronous( ) {
252252 let host = WorkflowHost ( workflow: ParentWorkflow ( ) )
253253
254- let initialScreen = host. rendering. value
254+ let initialScreen = host. rendering
255255 XCTAssertEqual ( 0 , initialScreen. count)
256256 initialScreen. update ( )
257257
258258 // This update happens immediately as a new rendering is generated synchronously.
259259 // Both the child updates from the action (incrementing state by 1) as well as the
260260 // parent from the output (incrementing its state by 10)
261- XCTAssertEqual ( 11 , host. rendering. value . count)
261+ XCTAssertEqual ( 11 , host. rendering. count)
262262
263263 struct ParentWorkflow : Workflow {
264264 struct State {
@@ -317,11 +317,11 @@ final class ConcurrencyTests: XCTestCase {
317317 outputExpectation. fulfill ( )
318318 }
319319
320- let cancellable = host. rendering . sink { rendering in
320+ let cancellable = host. renderingPublisher . sink { rendering in
321321 renderingExpectation. fulfill ( )
322322 }
323323
324- let screen = host. rendering. value
324+ let screen = host. rendering
325325
326326 XCTAssertEqual ( 0 , screen. count)
327327
@@ -330,7 +330,7 @@ final class ConcurrencyTests: XCTestCase {
330330
331331 wait ( for: [ renderingExpectation, outputExpectation] , timeout: 1.0 )
332332
333- XCTAssertEqual ( 101 , host. rendering. value . count)
333+ XCTAssertEqual ( 101 , host. rendering. count)
334334
335335 cancellable. cancel ( )
336336 outputCancellable. cancel ( )
@@ -343,18 +343,18 @@ final class ConcurrencyTests: XCTestCase {
343343 func test_multipleAnyWorkflowAction_sinksDontOverrideEachOther( ) {
344344 let host = WorkflowHost ( workflow: AnyActionWorkflow ( ) )
345345
346- let initialScreen = host. rendering. value
346+ let initialScreen = host. rendering
347347 XCTAssertEqual ( 0 , initialScreen. count)
348348
349349 // Update using the first action.
350350 initialScreen. updateFirst ( )
351351
352- let secondScreen = host. rendering. value
352+ let secondScreen = host. rendering
353353 XCTAssertEqual ( 1 , secondScreen. count)
354354
355355 // Update using the second action.
356356 secondScreen. updateSecond ( )
357- XCTAssertEqual ( 11 , host. rendering. value . count)
357+ XCTAssertEqual ( 11 , host. rendering. count)
358358
359359 struct AnyActionWorkflow : Workflow {
360360 enum Output {
0 commit comments