Skip to content

Commit

Permalink
remove for now
Browse files Browse the repository at this point in the history
  • Loading branch information
stephencelis committed Nov 8, 2023
1 parent cbc7df1 commit bdeafae
Showing 1 changed file with 0 additions and 54 deletions.
54 changes: 0 additions & 54 deletions Sources/ComposableArchitecture/TestStore.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1519,40 +1519,6 @@ extension TestStore where State: Equatable {
}
}

@MainActor
public func receive<Value: Equatable>(
_ keyPath: CaseKeyPath<Action, Value>,
_ value: Value,
timeout nanoseconds: UInt64? = nil,
assert updateStateToExpectedResult: ((_ state: inout State) throws -> Void)? = nil,
file: StaticString = #file,
line: UInt = #line
) async where Action: CasePathable {
await XCTFailContext.$current.withValue(XCTFailContext(file: file, line: line)) {
guard !self.reducer.inFlightEffects.isEmpty
else {
_ = {
self._receive(
AnyCasePath(keyPath), assert: updateStateToExpectedResult, file: file, line: line
)
}()
return
}
await self.receiveAction(
matching: { $0[case: keyPath] == value },
timeout: nanoseconds,
file: file,
line: line
)
_ = {
self._receive(
AnyCasePath(keyPath), assert: updateStateToExpectedResult, file: file, line: line
)
}()
await Task.megaYield()
}
}

#if (canImport(RegexBuilder) || !os(macOS) && !targetEnvironment(macCatalyst))
/// Asserts an action was received matching a case path and asserts how the state changes.
///
Expand Down Expand Up @@ -1636,26 +1602,6 @@ extension TestStore where State: Equatable {
await Task.megaYield()
}
}

@MainActor
@available(iOS 16, macOS 13, tvOS 16, watchOS 9, *)
public func receive<Value: Equatable>(
_ keyPath: CaseKeyPath<Action, Value>,
_ value: Value,
timeout duration: Duration,
assert updateStateToExpectedResult: ((_ state: inout State) throws -> Void)? = nil,
file: StaticString = #file,
line: UInt = #line
) async where Action: CasePathable {
await self.receive(
keyPath,
value,
timeout: duration.nanoseconds,
assert: updateStateToExpectedResult,
file: file,
line: line
)
}
#endif

private func receiveAction(
Expand Down

0 comments on commit bdeafae

Please sign in to comment.