test: add unit tests for both parts

This commit is contained in:
2025-11-29 16:06:42 +01:00
parent 8938992384
commit 9521677ca8

View File

@@ -0,0 +1,32 @@
package dayfive
import "testing"
func TestPartOne(t *testing.T) {
input := []string{
"ugknbfddgicrmopn",
"aaa",
"jchzalrnumimnmhp",
"haegwjzuvuyypxyu",
"dvszwmarrgswjxmb",
}
expected := 2
got := PartOne(input)
if got != expected {
t.Errorf("PartOne() = %d, want %d", got, expected)
}
}
func TestPartTwo(t *testing.T) {
input := []string{
"qjhvhtzxzqqjkmpb",
"xxyxx",
"uurcxstgmygtbstg",
"ieodomkazucvgmuy",
}
expected := 2
got := PartTwo(input)
if got != expected {
t.Errorf("PartTwo() = %d, want %d", got, expected)
}
}