numeric_literals: Numeric literal mutators

View source: R/mutator-presets.R

numeric_literalsR Documentation

Numeric literal mutators

Description

Returns a ready-made list of numeric_increment() and numeric_decrement() mutators that shift every numeric literal by 1.

Usage

numeric_literals()

Details

Use on any file with numeric constants used as thresholds, counts, or offsets. A surviving mutant means tests never verify the exact value of the constant — asserting the precise numeric result rather than a property (e.g. sign) kills it.

Value

A list of 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

numeric_literals()

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

## End(Not run)

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