Swift edition
Library methods
Operators that swap a standard library method for its counterpart: the other end, the other case, the other bound.
| Operator | Changes | Set |
|---|---|---|
library/swap-string | hasPrefix and hasSuffix, uppercased and lowercased | defaults |
library/swap-math | min and max, floor and ceil | defaults |
library/swap-ends | first and last, and the methods that work at either end | stronger |
library/swap-index-of | firstIndex and lastIndex | stronger |
The mutants each makes, on samples/operators/Sources/Operators/Library.swift:
mutastic mutants samples/operators --at=Sources/Operators/Library.swift:1-99 --operators=library/swap-string,library/swap-math,library/swap-ends,library/swap-index-ofm3a3f396b Sources/Operators/Library.swift:3:8 library/swap-string hasPrefix becomes hasSuffix in isCommentm19ec4f44 Sources/Operators/Library.swift:8:3 library/swap-math min becomes max in cappedDiscountm0d9b5f2c Sources/Operators/Library.swift:13:10 library/swap-ends last becomes first in latestmcf206182 Sources/Operators/Library.swift:18:8 library/swap-index-of lastIndex becomes firstIndex in extensionStartno estimate: no run is recorded here yet; run once to get estimates, or add --estimate4 mutantsSwap string
Section titled “Swap string”library/swap-string, in the defaults. Each becomes its counterpart.
Swap math
Section titled “Swap math”library/swap-math, in the defaults. Each becomes its counterpart.
Swap ends
Section titled “Swap ends”library/swap-ends, in stronger. first and last, removeFirst and removeLast, popFirst and popLast, dropFirst and dropLast, and prefix and suffix each become the other.
Swap index of
Section titled “Swap index of”library/swap-index-of, in stronger. Each becomes the other. Only a test with the value there twice tells them apart.
- Every operator, in one table.