25 lines
473 B
Go
25 lines
473 B
Go
|
package day_01_test
|
||
|
|
||
|
import (
|
||
|
"advent_of_code_2024/day_01"
|
||
|
_ "embed"
|
||
|
"testing"
|
||
|
)
|
||
|
|
||
|
//go:embed example_data.txt
|
||
|
var BasicExampleData string
|
||
|
|
||
|
func TestBasicSolutionExample(t *testing.T) {
|
||
|
result := day_01.SolveBasic(BasicExampleData)
|
||
|
if result != 11 {
|
||
|
t.Fatalf("Expected 11 received %d", result)
|
||
|
}
|
||
|
}
|
||
|
|
||
|
func TestComplexSolutionExample(t *testing.T) {
|
||
|
result := day_01.SolveComplex(BasicExampleData)
|
||
|
if result != 31 {
|
||
|
t.Fatalf("Expected 31 received %d", result)
|
||
|
}
|
||
|
}
|