Replaces mode and unit atoms in supported standard-library calls. Each replacement is valid for that function and argument position.
Time and calendar units
DateTime.add/3,4,DateTime.diff/3, and the correspondingNaiveDateTimeandTimecalls: replace the trailing time unit with an adjacent unit.DateTime.truncate/2,NaiveDateTime.truncate/2, andTime.truncate/2: replace:microsecond,:millisecond, or:secondwith an adjacent precision.System.system_time/1,System.monotonic_time/1,System.os_time/1, and both unit arguments ofSystem.convert_time_unit/3: replace the clock unit.:nativechanges to:second.DateTime.from_unix/2,3,DateTime.from_unix!/2,3, andDateTime.to_unix/2: replace the timestamp unit.DateTime.shift/2,3,NaiveDateTime.shift/2,Time.shift/2, andDate.shift/2: replace each duration key with an adjacent valid unit while retaining its amount.Timeaccepts only time units andDateonly date units.:microsecondis excluded because its value has a different shape.Date.day_of_week/2,Date.beginning_of_week/2, andDate.end_of_week/2: replace the starting weekday with an adjacent day.:defaultchanges to:tuesday.
String and encoding modes
String.upcase/2,String.downcase/2, andString.capitalize/2::greekand:turkicchange to:default.:defaultand:asciiare not exchanged.String.normalize/2: exchange:nfcwith:nfd, and:nfkcwith:nfkd.DateTime.to_iso8601/2,3and the correspondingNaiveDateTime,Time, andDatecalls: exchange:extendedand:basic.URI.encode_query/2andURI.decode_query/3: exchange:www_formand:rfc3986.
Sort modes
For Enum.sort/2, Enum.sort_by/3, and List.keysort/3, the mutator exchanges :asc and :desc. It also changes the direction in {:asc | :desc, module} tuples. A literal module sorter, such as Enum.sort(values, Date), becomes {:desc, Date}. Variables and function sorters are not wrapped.
Keyword option modes
- The
case:option forBase.encode16/2,Base.decode16/2,Base.decode16!/2, and the corresponding Base32 and hex Base32 functions exchanges:upperand:lower.:mixedis unchanged. - The
return:option forRegex.scan/3andRegex.run/3exchanges:indexand:binary. - The
on:option forRegex.split/3changes:firstand:allto:none;:none,:all_but_first, and:all_nameschange to:first. Lists of capture references are unchanged.
Ordered sets use adjacent replacements, so a position produces at most two mutants. Unrecognized atoms and values of other types are ignored.
This family is enabled by default. It matches aliased and piped calls and locates the option at its effective argument position. Because it rewrites the whole call, overlapping Mutare.Mutators.AtomLiteral and Mutare.Mutators.AliasLiteral leaf mutants are removed.