day 3 tests
This commit is contained in:
parent
839613668c
commit
a5afb8b355
2 changed files with 26 additions and 0 deletions
10
test/2023_day3_example.txt
Normal file
10
test/2023_day3_example.txt
Normal file
|
@ -0,0 +1,10 @@
|
|||
467..114..
|
||||
...*......
|
||||
..35..633.
|
||||
......#...
|
||||
617*......
|
||||
.....+.58.
|
||||
..592.....
|
||||
......755.
|
||||
...$.*....
|
||||
.664.598..
|
16
test/2023_day3_test.exs
Normal file
16
test/2023_day3_test.exs
Normal file
|
@ -0,0 +1,16 @@
|
|||
defmodule Day3Test do
|
||||
use ExUnit.Case
|
||||
|
||||
test "part 1 should solve example input" do
|
||||
{_, content} = File.read("./test/2023_day3_example.txt")
|
||||
content = content |> String.split("\n")
|
||||
assert Mix.Tasks.Day3.part1(content) == 4361
|
||||
end
|
||||
|
||||
test "part 2 should solve example input" do
|
||||
{_, content} = File.read("./test/2023_day3_example.txt")
|
||||
content = content |> String.split("\n")
|
||||
assert Mix.Tasks.Day3.part2(content) == 467_835
|
||||
end
|
||||
|
||||
end
|
Loading…
Add table
Reference in a new issue