From b91e34bc8e26d1e2311fd83b851ffffdd30ac2c6 Mon Sep 17 00:00:00 2001 From: Kharec Date: Thu, 4 Dec 2025 06:32:20 +0100 Subject: [PATCH] test: add unit test for part one --- internal/2025/DayFour/code_test.go | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 internal/2025/DayFour/code_test.go diff --git a/internal/2025/DayFour/code_test.go b/internal/2025/DayFour/code_test.go new file mode 100644 index 0000000..40b1556 --- /dev/null +++ b/internal/2025/DayFour/code_test.go @@ -0,0 +1,24 @@ +package dayfour + +import "testing" + +var testInput = []string{ + "..@@.@@@@.", + "@@@.@.@.@@", + "@@@@@.@.@@", + "@.@@@@..@.", + "@@.@@@@.@@", + ".@@@@@@@.@", + ".@.@.@.@@@", + "@.@@@.@@@@", + ".@@@@@@@@.", + "@.@.@@@.@.", +} + +func TestPartOne(t *testing.T) { + expected := 13 + got := PartOne(testInput) + if got != expected { + t.Errorf("PartOne() = %d, want %d", got, expected) + } +}