View source: R/mutator-presets.R
| logical_operators | R Documentation |
Returns a ready-made list of operator() mutators covering short-circuit
(&&/||) and vectorised (&/|) logical operator swaps.
logical_operators()
Use on any file with compound conditions (if (a && b)). A surviving mutant
from this preset typically means test inputs are symmetric — both flags
TRUE or both FALSE. Adding a test with one flag TRUE and the other
FALSE exposes the difference between && and || and kills the mutant.
A list of operator() mutators.
vignette("mutators", package = "muttest") for the full operator table
and a worked example showing the symmetric-input pattern.
vignette("interpreting-results", package = "muttest") for how to
diagnose survivors and fix the underlying test weakness.
logical_operators()
## Not run:
plan <- muttest_plan(
source_files = "R/access.R",
mutators = logical_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.