tests: add 2022D1 unit tests

This commit is contained in:
2025-11-26 16:05:00 +01:00
parent 2d5e05ae8b
commit 3fdb921aae

View File

@@ -0,0 +1,36 @@
package dayone
import "testing"
var testInput = []string{
"1000",
"2000",
"3000",
"",
"4000",
"",
"5000",
"6000",
"",
"7000",
"8000",
"9000",
"",
"10000",
}
func TestPartOne(t *testing.T) {
expected := 24000
got := PartOne(testInput)
if got != expected {
t.Errorf("PartOne() = %d, want %d", got, expected)
}
}
func TestPartTwo(t *testing.T) {
expected := 45000
got := PartTwo(testInput)
if got != expected {
t.Errorf("PartTwo() = %d, want %d", got, expected)
}
}