Mutare.Mutators.DefaultDrop (mutare v0.1.0)

Copy Markdown View Source

Drops a trailing optional argument so the call uses its default value.

Not-found defaults — implicit nil

These lookups use nil when the optional fallback is removed:

The _lazy forms also change to their non-lazy counterpart.

Refinement defaults — a precision, base, separator, or fill

These calls revert to their standard precision, base, separator, fill, or trimming behavior:

A call is skipped when its trailing literal already equals the implicit default: nil for the lookups, 0 for the rounding precision, 10 for the integer base, "" for Enum.join, " " for the pads — Map.get(m, k, nil), Float.round(x, 0), Integer.to_string(n, 10), Enum.join(xs, ""), String.pad_leading(s, n, " ") are all unchanged. List.flatten(xs, []) is also skipped because [] is the implicit tail. Non-default literals, variables, and expressions are eligible.

Lazy fallbacks are always eligible. The string argument to String.trim/2 and its directional variants is also always eligible because no string value reproduces the default whitespace behavior.

Default comparison uses the decoded value of a string literal.

This mutator is enabled by default and matches aliased and imported calls. It may produce a separate mutant alongside: Mutare.Mutators.CallRemoval removes String.trim/pad_leading/pad_trailing outright, while this family retains the call with default behavior; Mutare.Mutators.Numeric changes Float.ceil to Float.floor or vice versa while retaining the precision.