Further output improvements

This commit is contained in:
bluepython508
2023-12-03 10:00:10 +00:00
parent c086fc1773
commit 2ae3b6cf7b

View File

@@ -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