28 lines
534 B
Go
28 lines
534 B
Go
|
package day_03_test
|
||
|
|
||
|
import (
|
||
|
"advent_of_code_2024/day_03"
|
||
|
_ "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_03.SolveBasic(ExampleData)
|
||
|
if result != 161 {
|
||
|
t.Fatalf("Expected 161 received %d", result)
|
||
|
}
|
||
|
}
|
||
|
|
||
|
func TestComplexSolutionExample(t *testing.T) {
|
||
|
result := day_03.SolveComplex(ComplexExampleData)
|
||
|
if result != 48 {
|
||
|
t.Fatalf("Expected 48 received %d", result)
|
||
|
}
|
||
|
}
|