advent-of-code/aoc2023/day21/main_test.go
2024-10-30 13:32:44 -06:00

42 lines
636 B
Go

package main
import (
"bufio"
"bytes"
"testing"
_ "embed"
"github.com/matryer/is"
)
//go:embed example.txt
var example []byte
//go:embed input.txt
var input []byte
func TestExample(t *testing.T) {
is := is.New(t)
scan := bufio.NewScanner(bytes.NewReader(example))
result, err := runner(6)(scan)
is.NoErr(err)
t.Log(result)
is.Equal(result.valuePT1, 16)
is.Equal(result.valuePT2, 0)
}
func TestSolution(t *testing.T) {
is := is.New(t)
scan := bufio.NewScanner(bytes.NewReader(input))
result, err := runner(64)(scan)
is.NoErr(err)
t.Log(result)
is.Equal(result.valuePT1, 3709)
is.Equal(result.valuePT2, 0)
}