From 6bc4c1b5a50e1f4ce8518645559ea3d4e6a49633 Mon Sep 17 00:00:00 2001 From: Kharec Date: Fri, 28 Nov 2025 16:44:58 +0100 Subject: [PATCH] test: add unit test for p1 --- internal/2015/DayTwo/code_test.go | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 internal/2015/DayTwo/code_test.go diff --git a/internal/2015/DayTwo/code_test.go b/internal/2015/DayTwo/code_test.go new file mode 100644 index 0000000..869346b --- /dev/null +++ b/internal/2015/DayTwo/code_test.go @@ -0,0 +1,23 @@ +package daytwo + +import "testing" + +func TestPartOne(t *testing.T) { + tests := []struct { + name string + input string + expected int + }{ + {"2x3x4", "2x3x4", 58}, + {"1x1x10", "1x1x10", 43}, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + got := PartOne([]string{tt.input}) + if got != tt.expected { + t.Errorf("PartOne(%q) = %d, want %d", tt.input, got, tt.expected) + } + }) + } +}