test: add unit test for part two

This commit is contained in:
2026-02-03 16:10:35 +01:00
parent 9de558024f
commit 948be64119

View File

@@ -2,7 +2,8 @@ package dayeleven
import "testing"
var testInput = []string{
func TestPartOne(t *testing.T) {
testInput := []string{
"aaa: you hhh",
"you: bbb ccc",
"bbb: ddd eee",
@@ -13,12 +14,33 @@ var testInput = []string{
"ggg: out",
"hhh: ccc fff iii",
"iii: out",
}
func TestPartOne(t *testing.T) {
}
expected := 5
got := PartOne(testInput)
if got != expected {
t.Errorf("PartOne() = %d, want %d", got, expected)
}
}
func TestPartTwo(t *testing.T) {
testInput := []string{
"svr: aaa bbb",
"aaa: fft",
"fft: ccc",
"bbb: tty",
"tty: ccc",
"ccc: ddd eee",
"ddd: hub",
"hub: fff",
"eee: dac",
"dac: fff",
"fff: ggg hhh",
"ggg: out",
"hhh: out",
}
expected := 2
got := PartTwo(testInput)
if got != expected {
t.Errorf("PartTwo() = %d, want %d", got, expected)
}
}