advent_of_code_2024/day_12/solution_test.go

35 lines
690 B
Go

package day_12_test
import (
"advent_of_code_2024/day_12"
_ "embed"
"testing"
)
//go:embed example_data.txt
var ExampleData string
//go:embed example_data_01.txt
var ExampleData01 string
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)
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)
}
}