Further output improvements
This commit is contained in:
@@ -131,16 +131,12 @@ defmodule Mix.Tasks.Aoc do
|
|||||||
p2 = mod.part2(parsed)
|
p2 = mod.part2(parsed)
|
||||||
|
|
||||||
result = fn (part, got, expected) ->
|
result = fn (part, got, expected) ->
|
||||||
if expected do
|
cond do
|
||||||
if stringify(got) != expected do
|
stringify(got) == expected ->
|
||||||
IO.puts(IO.ANSI.format [:red, "Test #{test}.#{part} failed: expected #{expected}"])
|
IO.puts(IO.ANSI.format [:green, "Test #{test}.#{part} succeeded (#{expected})"])
|
||||||
dbg(got)
|
expected ->
|
||||||
else
|
IO.puts(IO.ANSI.format [:red, "Test #{test}.#{part} failed: expected #{expected}, got #{stringify(got)}"])
|
||||||
IO.puts(IO.ANSI.format [:green, "Test #{test}.#{part} succeeded"])
|
true -> IO.puts("Test #{test}.#{part}: #{stringify(got)}")
|
||||||
end
|
|
||||||
else
|
|
||||||
IO.puts("Test #{test}.#{part}:")
|
|
||||||
dbg(got)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user