Skip to content

Commit

Permalink
Run swift-format
Browse files Browse the repository at this point in the history
  • Loading branch information
mbrandonw authored and github-actions[bot] committed Sep 10, 2024
1 parent 02292e7 commit 5e9943d
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 44 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2618,36 +2618,36 @@ final class PresentationReducerTests: BaseTCATestCase {
}

#if !os(visionOS)
@Reducer
struct TestEphemeralBindingDismissalFeature {
@ObservableState
struct State: Equatable {
@Presents var alert: AlertState<Never>?
}
enum Action: Equatable {
case alert(PresentationAction<Never>)
}
var body: some ReducerOf<Self> {
Reduce { state, action in
return .none
@Reducer
struct TestEphemeralBindingDismissalFeature {
@ObservableState
struct State: Equatable {
@Presents var alert: AlertState<Never>?
}
enum Action: Equatable {
case alert(PresentationAction<Never>)
}
var body: some ReducerOf<Self> {
Reduce { state, action in
return .none
}
.ifLet(\.$alert, action: /Action.alert)
}
.ifLet(\.$alert, action: /Action.alert)
}
}
@MainActor
func testEphemeralBindingDismissal() async {
@Perception.Bindable var store = Store(
initialState: TestEphemeralBindingDismissalFeature.State(
alert: AlertState { TextState("Oops!") }
)
) {
TestEphemeralBindingDismissalFeature()
}
@MainActor
func testEphemeralBindingDismissal() async {
@Perception.Bindable var store = Store(
initialState: TestEphemeralBindingDismissalFeature.State(
alert: AlertState { TextState("Oops!") }
)
) {
TestEphemeralBindingDismissalFeature()
}

XCTAssertNotNil(store.alert)
$store.scope(state: \.alert, action: \.alert).wrappedValue = nil
XCTAssertNil(store.alert)
}
XCTAssertNotNil(store.alert)
$store.scope(state: \.alert, action: \.alert).wrappedValue = nil
XCTAssertNil(store.alert)
}
#endif
}

Expand Down
34 changes: 17 additions & 17 deletions Tests/ComposableArchitectureTests/StoreTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1088,26 +1088,26 @@ final class StoreTests: BaseTCATestCase {
var body: some ReducerOf<Self> { EmptyReducer() }
}

#if !os(visionOS)
@MainActor
func testInvalidatedStoreScope() async throws {
@Perception.Bindable var store = Store(
initialState: InvalidatedStoreScopeParentFeature.State(
child: InvalidatedStoreScopeChildFeature.State(
grandchild: InvalidatedStoreScopeGrandchildFeature.State()
#if !os(visionOS)
@MainActor
func testInvalidatedStoreScope() async throws {
@Perception.Bindable var store = Store(
initialState: InvalidatedStoreScopeParentFeature.State(
child: InvalidatedStoreScopeChildFeature.State(
grandchild: InvalidatedStoreScopeGrandchildFeature.State()
)
)
)
) {
InvalidatedStoreScopeParentFeature()
}
store.send(.tap)
) {
InvalidatedStoreScopeParentFeature()
}
store.send(.tap)

@Perception.Bindable var childStore = store.scope(state: \.child, action: \.child)!
let grandchildStoreBinding = $childStore.scope(state: \.grandchild, action: \.grandchild)
@Perception.Bindable var childStore = store.scope(state: \.child, action: \.child)!
let grandchildStoreBinding = $childStore.scope(state: \.grandchild, action: \.grandchild)

store.send(.child(.dismiss))
grandchildStoreBinding.wrappedValue = nil
}
store.send(.child(.dismiss))
grandchildStoreBinding.wrappedValue = nil
}
#endif

@MainActor
Expand Down

0 comments on commit 5e9943d

Please sign in to comment.