Mutare.Decimal.Comparison (mutare_decimal v0.1.0)

Copy Markdown View Source

:decimal_comparison — swaps Decimal comparison calls.

The predicate swaps mirror relational-operator boundary, direction, and complement mutants:

Decimal.gt?(a, b)  # -> Decimal.gte?(a, b) / Decimal.lt?(a, b) / Decimal.lte?(a, b)
Decimal.gte?(a, b) # -> Decimal.gt?(a, b) / Decimal.lte?(a, b) / Decimal.lt?(a, b)
Decimal.lt?(a, b)  # -> Decimal.lte?(a, b) / Decimal.gt?(a, b) / Decimal.gte?(a, b)
Decimal.lte?(a, b) # -> Decimal.lt?(a, b) / Decimal.gte?(a, b) / Decimal.gt?(a, b)

Decimal.eq?/2 and Decimal.equal?/2 mutate to strict ordering predicates, min/2 and max/2 swap, and compare/2, compare/3, and deprecated cmp/2 reverse their first two operands when both operands are visible in the call node and written differently (reversing identical operands would re-render the original program).

Summary

Functions

The target-operation labels accepted by qualified mutare ignore directives.

Functions

variants()

@spec variants() :: [atom()]

The target-operation labels accepted by qualified mutare ignore directives.