View source: R/mutator-operator.R
| operator | R Documentation |
Produces one mutant per occurrence of from in the source file, replacing
it with to. A surviving mutant means your tests cannot distinguish the
original operator from the replacement — pointing at the missing assertion
or input value.
operator(from, to)
from |
The operator to replace (e.g. |
to |
The replacement operator. |
Use this when you need a specific swap not covered by the preset collections
(arithmetic_operators(), comparison_operators(), logical_operators()).
A Mutator object.
comparison_operators(), arithmetic_operators(), logical_operators()
for ready-made preset lists.
vignette("mutators", package = "muttest") for the full operator
reference with examples of what each preset catches.
vignette("interpreting-results", package = "muttest") to learn how to
read surviving mutants and strengthen the tests they expose.
operator("+", "-")
operator("==", "!=")
operator(">", ">=") # probe the strict vs. non-strict boundary
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.