comparison_operators: Comparison operator mutators

View source: R/mutator-presets.R

comparison_operatorsR Documentation

Comparison operator mutators

Description

Returns a ready-made list of operator() mutators covering direction swaps (</>, <=/>=, ==/!=) and boundary shifts (</<=, >/>=).

Usage

comparison_operators()

Details

Use on any file with threshold logic, range checks, or filter conditions. A surviving mutant from this preset means the exact boundary value implied by the operator was never passed to the function — adding a test at that boundary value kills it.

Value

A list of operator() mutators.

See Also

vignette("mutators", package = "muttest") for the full operator table and a worked example showing the missing boundary value pattern.

vignette("interpreting-results", package = "muttest") for how to diagnose survivors and fix the underlying test weakness.

Examples

comparison_operators()

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

## End(Not run)

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