advent_of_code_2024/day_04/solution_test.go

28 lines
530 B
Go
Raw Normal View History

2024-12-04 17:26:41 +00:00
package day_04_test
import (
"advent_of_code_2024/day_04"
_ "embed"
"testing"
)
//go:embed example_data.txt
var ExampleData string
//go:embed complex_example_data.txt
var ComplexExampleData string
func TestBasicSolutionExample(t *testing.T) {
result := day_04.SolveBasic(ExampleData)
if result != 18 {
t.Fatalf("Expected 18 received %d", result)
}
}
func TestComplexSolutionExample(t *testing.T) {
result := day_04.SolveComplex(ComplexExampleData)
if result != 9 {
t.Fatalf("Expected 9 received %d", result)
}
}