2025-12-19 07:42:00 -06:00
|
|
|
package main_test
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
|
|
solution "github.com/StevanFreeborn/advent-of-code-2025/cmd/10"
|
|
|
|
|
)
|
|
|
|
|
|
2025-12-20 07:03:12 -06:00
|
|
|
func TestSolvePartOneWithExampleInput(t *testing.T) {
|
|
|
|
|
expected := 7
|
2025-12-19 07:42:00 -06:00
|
|
|
|
|
|
|
|
result := solution.SolvePartOne("EXAMPLE.txt")
|
|
|
|
|
|
|
|
|
|
if result != expected {
|
|
|
|
|
t.Errorf("got %d but wanted %d", result, expected)
|
|
|
|
|
}
|
|
|
|
|
}
|
2025-12-20 07:03:12 -06:00
|
|
|
|
|
|
|
|
func TestSolvePartOneWithInput(t *testing.T) {
|
2025-12-20 13:20:49 -06:00
|
|
|
expected := 527
|
2025-12-20 07:03:12 -06:00
|
|
|
|
|
|
|
|
result := solution.SolvePartOne("INPUT.txt")
|
|
|
|
|
|
|
|
|
|
if result != expected {
|
|
|
|
|
t.Errorf("got %d but wanted %d", result, expected)
|
|
|
|
|
}
|
|
|
|
|
}
|
2025-12-20 13:53:21 -06:00
|
|
|
|
|
|
|
|
func TestSolvePartTwoWithExampleInput(t *testing.T) {
|
2025-12-20 22:28:28 -06:00
|
|
|
expected := 33
|
2025-12-20 13:53:21 -06:00
|
|
|
|
|
|
|
|
result := solution.SolvePartTwo("EXAMPLE.txt")
|
|
|
|
|
|
|
|
|
|
if result != expected {
|
|
|
|
|
t.Errorf("got %d but wanted %d", result, expected)
|
|
|
|
|
}
|
|
|
|
|
}
|
2025-12-20 22:28:28 -06:00
|
|
|
|
|
|
|
|
func TestSolvePartTwoWithInput(t *testing.T) {
|
2025-12-24 18:13:00 -06:00
|
|
|
expected := 19810
|
2025-12-20 22:28:28 -06:00
|
|
|
|
|
|
|
|
result := solution.SolvePartTwo("INPUT.txt")
|
|
|
|
|
|
|
|
|
|
if result != expected {
|
|
|
|
|
t.Errorf("got %d but wanted %d", result, expected)
|
|
|
|
|
}
|
|
|
|
|
}
|