View source: R/mutator-presets.R
| arithmetic_operators | R Documentation |
Returns a ready-made list of operator() mutators covering common
arithmetic swaps: +/-, *//, ^/*, %%/*, %/%//.
arithmetic_operators()
Use on any file that performs calculations. A surviving mutant from this
preset typically means an assertion checks a property of the result (sign,
order) rather than a specific value — replacing expect_gte() with
expect_equal() and a computed expected value usually kills it.
A list of operator() mutators.
vignette("mutators", package = "muttest") for the full operator table
and a worked example showing the direction-insensitive assertion pattern.
vignette("interpreting-results", package = "muttest") for how to
diagnose survivors and fix the underlying test weakness.
arithmetic_operators()
## Not run:
plan <- muttest_plan(
source_files = "R/stats.R",
mutators = arithmetic_operators()
)
muttest(plan, "tests/testthat")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.