Skip to content
mutastic

Swift edition

Iterators

Operators that change a chain over a collection: how it matches, and what it leaves in. Where the Java edition has streams, Swift has these.

OperatorChangesSet
stream/swap-matchcontains(where:) and allSatisfydefaults
stream/remove-stagea stage of a chain left outdefaults

The mutants each makes, on samples/operators/Sources/Operators/Iterators.swift:

Terminal window
mutastic mutants samples/operators --at=Sources/Operators/Iterators.swift:1-99 --operators=stream/swap-match,stream/remove-stage
Terminal window
m3055c30a Sources/Operators/Iterators.swift:3:8 stream/swap-match contains(where: becomes allSatisfy( in anyOverdue
m1beed0ff Sources/Operators/Iterators.swift:8:11 stream/remove-stage .filter { $0 > 0 } is left out in paidTotal
no estimate: no run is recorded here yet; run once to get estimates, or add --estimate
2 mutants

stream/swap-match, in the defaults. Each becomes the other: any element matching for every element matching.

stream/remove-stage, in the defaults. A filter, sorted, reversed, dropFirst, dropLast, prefix or suffix is left out of a chain. sorted and reversed aren’t left out before an end that doesn’t notice order, such as count or contains.