Mutare.Decimal.Comparison (mutare_decimal v0.2.1)

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 those are written differently (reversing identical operands would re-render the original program). A pipe stage is the call it stands for, so a |> Decimal.compare(b) is reversed like Decimal.compare(a, b).

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.