boolean_literals: Boolean literal mutators

View source: R/mutator-presets.R

boolean_literalsR Documentation

Boolean literal mutators

Description

Returns a ready-made list of boolean_literal() mutators covering all canonical flips: TRUE/FALSE and T/F.

Usage

boolean_literals()

Details

Use on any file that passes or returns boolean flags. A surviving mutant from this preset typically means a test checks a side effect of the flag (e.g. the branch taken) rather than the flag value itself — adding expect_true()/expect_false() on the return value kills it.

Value

A list of boolean_literal() mutators.

See Also

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.

Examples

boolean_literals()

## Not run: 
plan <- muttest_plan(
  source_files = "R/flags.R",
  mutators = boolean_literals()
)
muttest(plan, "tests/testthat")

## End(Not run)

muttest documentation built on May 14, 2026, 5:10 p.m.