2024-12-12 08:16:52 +00:00
|
|
|
package day_12_test
|
|
|
|
|
|
|
|
import (
|
|
|
|
"advent_of_code_2024/day_12"
|
|
|
|
_ "embed"
|
|
|
|
"testing"
|
|
|
|
)
|
|
|
|
|
|
|
|
//go:embed example_data.txt
|
|
|
|
var ExampleData string
|
|
|
|
|
2024-12-12 09:04:22 +00:00
|
|
|
//go:embed example_data_01.txt
|
|
|
|
var ExampleData01 string
|
|
|
|
|
2024-12-12 08:16:52 +00:00
|
|
|
func TestBasicSolutionExample(t *testing.T) {
|
|
|
|
result := day_12.SolveBasic(ExampleData)
|
|
|
|
if result != 1930 {
|
|
|
|
t.Fatalf("Expected 1930 received %d", result)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func TestComplexSolutionExample(t *testing.T) {
|
|
|
|
result := day_12.SolveComplex(ExampleData)
|
2024-12-12 09:04:22 +00:00
|
|
|
if result != 1206 {
|
|
|
|
t.Fatalf("Expected 1206 received %d", result)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func TestComplexSolutionExample01(t *testing.T) {
|
|
|
|
result := day_12.SolveComplex(ExampleData01)
|
|
|
|
if result != 80 {
|
|
|
|
t.Fatalf("Expected 80 received %d", result)
|
2024-12-12 08:16:52 +00:00
|
|
|
}
|
|
|
|
}
|