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