test: add unit test for p1

This commit is contained in:
2025-11-28 16:44:58 +01:00
parent 7b0ccf8a40
commit 6bc4c1b5a5

View File

@@ -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)
}
})
}
}