55 lines
1.1 KiB
Go
55 lines
1.1 KiB
Go
|
package day_10_test
|
||
|
|
||
|
import (
|
||
|
"advent_of_code_2024/day_10"
|
||
|
_ "embed"
|
||
|
"testing"
|
||
|
)
|
||
|
|
||
|
//go:embed example_data.txt
|
||
|
var ExampleData string
|
||
|
|
||
|
//go:embed example_data_01.txt
|
||
|
var ExampleData01 string
|
||
|
|
||
|
//go:embed example_data_02.txt
|
||
|
var ExampleData02 string
|
||
|
|
||
|
//go:embed example_data_03.txt
|
||
|
var ExampleData03 string
|
||
|
|
||
|
func TestBasicSolutionExample(t *testing.T) {
|
||
|
result := day_10.SolveBasic(ExampleData)
|
||
|
if result != 36 {
|
||
|
t.Fatalf("Expected 36 received %d", result)
|
||
|
}
|
||
|
}
|
||
|
|
||
|
func TestBasicSolutionExample01(t *testing.T) {
|
||
|
result := day_10.SolveBasic(ExampleData01)
|
||
|
if result != 2 {
|
||
|
t.Fatalf("Expected 2 received %d", result)
|
||
|
}
|
||
|
}
|
||
|
|
||
|
func TestBasicSolutionExample02(t *testing.T) {
|
||
|
result := day_10.SolveBasic(ExampleData02)
|
||
|
if result != 3 {
|
||
|
t.Fatalf("Expected 3 received %d", result)
|
||
|
}
|
||
|
}
|
||
|
|
||
|
func TestBasicSolutionExample03(t *testing.T) {
|
||
|
result := day_10.SolveBasic(ExampleData03)
|
||
|
if result != 4 {
|
||
|
t.Fatalf("Expected 4 received %d", result)
|
||
|
}
|
||
|
}
|
||
|
|
||
|
func TestComplexSolutionExample(t *testing.T) {
|
||
|
result := day_10.SolveComplex(ExampleData)
|
||
|
if result != 2858 {
|
||
|
t.Fatalf("Expected 2858 received %d", result)
|
||
|
}
|
||
|
}
|