View source: R/mutator-presets.R
| na_literals | R Documentation |
Returns a ready-made list of na_literal() mutators covering common swaps
between NA, NULL, and the typed NA variants (NA_real_, NA_integer_,
NA_character_).
na_literals()
Use on any file that handles missing values or nullable results. A surviving
mutant typically means tests never distinguish NA from NULL, or never
check which typed NA is returned — adding expect_true(is.na(x)) and
expect_equal(class(x), "numeric") style assertions kills it.
A list of na_literal() 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.
na_literals()
## Not run:
plan <- muttest_plan(
source_files = "R/missing.R",
mutators = na_literals()
)
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.