From 9521677ca8a058dcad117a919e47e7c5e78361ab Mon Sep 17 00:00:00 2001 From: Kharec Date: Sat, 29 Nov 2025 16:06:42 +0100 Subject: [PATCH] test: add unit tests for both parts --- internal/2015/DayFive/code_test.go | 32 ++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 internal/2015/DayFive/code_test.go diff --git a/internal/2015/DayFive/code_test.go b/internal/2015/DayFive/code_test.go new file mode 100644 index 0000000..c5cdacf --- /dev/null +++ b/internal/2015/DayFive/code_test.go @@ -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) + } +}