advent-of-code/2020-elixir/test/day_01_test.exs

48 lines
634 B
Elixir
Raw Normal View History

2021-11-01 16:40:46 +01:00
defmodule Day01Test do
use ExUnit.Case
doctest Aoc.Solution.Day01
import Aoc.Solution.Day01
test "parses the input" do
input = """
1721
979
"""
expected = [1721, 979]
assert parse!(input) == expected
end
test "solves first part" do
input = """
1721
979
366
299
675
1456
"""
a = input |> parse!() |> solve_first_part()
assert a == 514_579
end
@tag :skip
test "solves second part" do
input = """
1721
979
366
299
675
1456
"""
a = input |> parse!() |> solve_second_part()
assert a == 130_933_530
end
end