Skip to content

Commit e0958d3

Browse files
mbrandonwgithub-actions[bot]
authored andcommitted
Run swift-format
1 parent 6ed45e8 commit e0958d3

File tree

1 file changed

+30
-30
lines changed

1 file changed

+30
-30
lines changed

Tests/ComposableArchitectureTests/ObserveTests.swift

+30-30
Original file line numberDiff line numberDiff line change
@@ -36,42 +36,42 @@
3636
}
3737

3838
#if DEBUG
39-
@MainActor
40-
func testNestedObservation() async throws {
41-
XCTExpectFailure {
42-
$0.compactDescription == """
43-
An "observe" was called from another "observe" closure, which can lead to \
44-
over-observation and unintended side effects.
39+
@MainActor
40+
func testNestedObservation() async throws {
41+
XCTExpectFailure {
42+
$0.compactDescription == """
43+
An "observe" was called from another "observe" closure, which can lead to \
44+
over-observation and unintended side effects.
4545
46-
Avoid nested closures by moving child observation into their own lifecycle methods.
47-
"""
48-
}
46+
Avoid nested closures by moving child observation into their own lifecycle methods.
47+
"""
48+
}
4949

50-
let model = Model()
51-
var counts: [Int] = []
52-
var innerObservation: Any!
53-
let observation = observe { [weak self] in
54-
guard let self else { return }
55-
counts.append(model.count)
56-
innerObservation = observe {
57-
_ = model.otherCount
50+
let model = Model()
51+
var counts: [Int] = []
52+
var innerObservation: Any!
53+
let observation = observe { [weak self] in
54+
guard let self else { return }
55+
counts.append(model.count)
56+
innerObservation = observe {
57+
_ = model.otherCount
58+
}
59+
}
60+
defer {
61+
_ = observation
62+
_ = innerObservation
5863
}
59-
}
60-
defer {
61-
_ = observation
62-
_ = innerObservation
63-
}
6464

65-
XCTAssertEqual(counts, [0])
65+
XCTAssertEqual(counts, [0])
6666

67-
model.count += 1
68-
try await Task.sleep(nanoseconds: 1_000_000)
69-
XCTAssertEqual(counts, [0, 1])
67+
model.count += 1
68+
try await Task.sleep(nanoseconds: 1_000_000)
69+
XCTAssertEqual(counts, [0, 1])
7070

71-
model.otherCount += 1
72-
try await Task.sleep(nanoseconds: 1_000_000)
73-
XCTAssertEqual(counts, [0, 1, 1])
74-
}
71+
model.otherCount += 1
72+
try await Task.sleep(nanoseconds: 1_000_000)
73+
XCTAssertEqual(counts, [0, 1, 1])
74+
}
7575
#endif
7676
}
7777

0 commit comments

Comments
 (0)