Muex.Mutator.EnumSemantics (Muex v0.8.0)

View Source

Elixir-specific mutator that swaps Enum functions for their semantic opposite.

  • Enum.filter <-> Enum.reject
  • Enum.all? <-> Enum.any?
  • Enum.min <-> Enum.max
  • Enum.take <-> Enum.drop
  • Enum.map <-> Enum.each

These swaps change observable behaviour (the filtered set, the boolean result, the selected element, the returned collection) while remaining type-compatible, so a surviving mutant points at a test that does not pin down which Enum operation the code actually relies on.

Only the function name is rewritten; the call arguments are preserved.