View source: R/mutator-presets.R
| index_mutations | R Documentation |
Returns a ready-made list of index_increment() and index_decrement()
mutators that shift every simple subscript index by 1.
index_mutations()
Use on any file that extracts elements from vectors or lists by position. Surviving mutants reveal off-by-one errors where tests only verify that something was extracted, not which element — asserting the exact value of the extracted element kills them.
A list of mutators.
vignette("mutators", package = "muttest") for the full mutator table.
vignette("interpreting-results", package = "muttest") for how to
diagnose survivors and fix the underlying test weakness.
index_mutations()
## Not run:
plan <- muttest_plan(
source_files = "R/selectors.R",
mutators = index_mutations()
)
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.