From f28611a7bfe3d5802b53f3eb7e8c278a0b0a8815 Mon Sep 17 00:00:00 2001 From: Kharec Date: Mon, 1 Dec 2025 20:09:29 +0100 Subject: [PATCH] test: add unit tests for p1/p2 --- internal/2018/DayThree/code_test.go | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 internal/2018/DayThree/code_test.go diff --git a/internal/2018/DayThree/code_test.go b/internal/2018/DayThree/code_test.go new file mode 100644 index 0000000..537209b --- /dev/null +++ b/internal/2018/DayThree/code_test.go @@ -0,0 +1,25 @@ +package daythree + +import "testing" + +var testInput = []string{ + "#1 @ 1,3: 4x4", + "#2 @ 3,1: 4x4", + "#3 @ 5,5: 2x2", +} + +func TestPartOne(t *testing.T) { + expected := 4 + got := PartOne(testInput) + if got != expected { + t.Errorf("PartOne() = %d, want %d", got, expected) + } +} + +func TestPartTwo(t *testing.T) { + expected := 3 + got := PartTwo(testInput) + if got != expected { + t.Errorf("PartTwo() = %d, want %d", got, expected) + } +}