test: add unit test for part one

This commit is contained in:
2026-01-11 01:08:59 +01:00
parent 0acaa0b143
commit 69ca7ec52c

View File

@@ -0,0 +1,16 @@
package dayfifteen
import "testing"
var testInput = []string{
"Butterscotch: capacity -1, durability -2, flavor 6, texture 3, calories 8",
"Cinnamon: capacity 2, durability 3, flavor -2, texture -1, calories 3",
}
func TestPartOne(t *testing.T) {
expected := 62842880
got := PartOne(testInput)
if got != expected {
t.Errorf("PartOne() = %d, want %d", got, expected)
}
}