TestSequence

@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
public struct TestSequence<Input, Failure> where Failure : Error
extension TestSequence: Sequence
extension TestSequence: RangeReplaceableCollection
extension TestSequence: ExpressibleByArrayLiteral
extension TestSequence: Equatable where Input: Equatable, Failure: Equatable

A collection of time-stamped Signals

  • Initializes the TestSequence with a series of tuples of the format (VirtualTime, Signal<Input, Failure>)

    Declaration

    Swift

    public init<S>(_ elements: S) where S : Sequence, S.Element == TestSequence<Input, Failure>.Element
  • Initializes an empty TestSequence

    Declaration

    Swift

    public init()
  • Returns a TestSequence containing the results of mapping the given closure over the sequence’s input elements.

    Declaration

    Swift

    public func mapInput<T>(_ transform: (Input) -> T) -> TestSequence<T, Failure>

    Parameters

    transform

    A mapping closure. transform accepts an element of this sequence’s Input type as its parameter and returns a transformed value of the same or of a different type.

    Return Value

    A TestSequence containing the transformed input elements

  • Returns a TestSequence containing the results of mapping the given closure over the sequence’s completion elements.

    Declaration

    Swift

    public func mapFailure<T>(_ transform: (Failure) -> T) -> TestSequence<Input, T> where T : Error

    Parameters

    transform

    A mapping closure. transform accepts an element of this sequence’s failure type as its parameter and returns a transformed error of the same or a different type

    Return Value

    A TestSequence containing the transformed completion elements

Sequence conformance

  • Declaration

    Swift

    public typealias Iterator = IndexingIterator<[Element]>
  • Declaration

    Swift

    public typealias Element = (VirtualTime, Signal<Input, Failure>)
  • Declaration

    Swift

    public  func makeIterator() -> IndexingIterator<[(VirtualTime, Signal<Input, Failure>)]>

RangeReplaceableCollection conformance

ExpressibleByArrayLiteral conformance

Available where Input: Equatable, Failure: Equatable

  • Declaration

    Swift

    public static func == (lhs: TestSequence<Input, Failure>, rhs: TestSequence<Input, Failure>) -> Bool