Skip to content

Commit

Permalink
fix nth occurence colors
Browse files Browse the repository at this point in the history
  • Loading branch information
tuomohopia committed Nov 18, 2023
1 parent 9119a41 commit 0542743
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions lib/mutix/report.ex
Original file line number Diff line number Diff line change
Expand Up @@ -89,18 +89,22 @@ defmodule Mutix.Report do

if index == 0 do
"""
#{IO.ANSI.format([:magenta, source_file_path])}:#{color(line, :magenta)} where ( #{color(from, :green)} ) was mutated into ( #{color(to, :red)} ):
#{color(source_file_path, :magenta)}:#{color(line, :magenta)} where ( #{color(from, :green)} ) was mutated into ( #{color(to, :red)} ):
#{context}
"""
else
"#{source_file_path} - line #{line} where the #{index + 1}. ( #{from} ) from left was mutated into ( #{to} )"
"""
#{source_file_path} - line #{line} where the #{index + 1}. ( #{color(from, :green)} ) from left was mutated into ( #{color(to, :red)} )
#{context}
"""
end
end

"""
#{IO.ANSI.format([:magenta, :bright, "Surviving mutants"])} - no test failed with these injections:
#{color("Surviving mutants", [:magenta, :bright])} - no test failed with these injections:
#{Enum.join(surviving, "\n ")}
"""
Expand Down

0 comments on commit 0542743

Please sign in to comment.