Files

47 lines
764 B
Go

package dayeleven
import "testing"
func TestPartOne(t *testing.T) {
testInput := []string{
"aaa: you hhh",
"you: bbb ccc",
"bbb: ddd eee",
"ccc: ddd eee fff",
"ddd: ggg",
"eee: out",
"fff: out",
"ggg: out",
"hhh: ccc fff iii",
"iii: out",
}
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)
}
}