26 lines
536 B
Elixir
26 lines
536 B
Elixir
defmodule AdventOfCode.Year2025.DialTest do
|
|
use ExUnit.Case, async: true
|
|
|
|
import AdventOfCode.Year2025.Dial
|
|
|
|
test "dial starts at 50" do
|
|
{ index, _ } = rotate([])
|
|
assert index == 50
|
|
end
|
|
|
|
test "rotate right increments index" do
|
|
{index, _} = rotate(["R1"])
|
|
assert index == 51
|
|
end
|
|
|
|
test "rotate left decrements index" do
|
|
{index, _} = rotate(["L1"])
|
|
assert index ==49
|
|
end
|
|
|
|
test "increments zero crossings when landing on zero" do
|
|
{_, zeroes} = rotate(["R50"])
|
|
assert zeroes == 1
|
|
end
|
|
end
|