mirror of
https://github.com/rjNemo/ai_advent_code_2024
synced 2026-06-12 13:36:39 +00:00
test: Add tests for Day 1 Historian Hysteria challenge
This commit is contained in:
parent
f1b0d483a3
commit
881c7335a0
1 changed files with 15 additions and 2 deletions
|
|
@ -2,7 +2,20 @@ defmodule AdventCode2024Test do
|
||||||
use ExUnit.Case
|
use ExUnit.Case
|
||||||
doctest AdventCode2024
|
doctest AdventCode2024
|
||||||
|
|
||||||
test "greets the world" do
|
describe "Day 1: Historian Hysteria" do
|
||||||
assert AdventCode2024.hello() == :world
|
test "calculates total distance between two lists using example input" do
|
||||||
|
left_list = [3, 4, 2, 1, 3, 3]
|
||||||
|
right_list = [4, 3, 5, 3, 9, 3]
|
||||||
|
|
||||||
|
assert AdventCode2024.calculate_total_distance(left_list, right_list) == 11
|
||||||
|
end
|
||||||
|
|
||||||
|
test "handles empty lists" do
|
||||||
|
assert AdventCode2024.calculate_total_distance([], []) == 0
|
||||||
|
end
|
||||||
|
|
||||||
|
test "handles single element lists" do
|
||||||
|
assert AdventCode2024.calculate_total_distance([1], [3]) == 2
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue