Mutare.Ecto.RepoAggregate (mutare_ecto v0.1.1)

Copy Markdown View Source

Swap the aggregate of a Repo.aggregate/3 call along an SQL-meaningful ladder — :sum:avg, :min:max. A surviving mutant means no test distinguishes, say, the sum of a column from its average: the aggregate is computed but its kind is unchecked.

:count is deliberately left alone, here as in the query-side catalog — see Mutare.Ecto.Aggregate.

Matched by resolving the call's module to one of the configured repo: modules (so the direct MyApp.Repo.aggregate, an aliased Repo.aggregate, and an imported form all match) and the function to aggregate. Pipe-aware: q |> Repo.aggregate(:sum, :col) carries the queryable as the piped left-hand side, so the aggregate atom sits one position earlier in the visible args — Mutare.Mutator.visible_index/2 recovers where.

Summary

Functions

Aggregate-swap mutations for a Repo.aggregate/3 node as labelled :aggregate tags, or [].

Functions

mutations(node, context)

@spec mutations(Macro.t(), Mutare.Ecto.Context.t()) :: [Mutare.Ecto.Tag.t()]

Aggregate-swap mutations for a Repo.aggregate/3 node as labelled :aggregate tags, or [].