test: add unit test for both parts

This commit is contained in:
2025-12-09 19:21:59 +01:00
parent 8bbf6662b1
commit ed445a8be7

View File

@@ -0,0 +1,28 @@
package daythree
import "testing"
func TestPartOne(t *testing.T) {
input := [][3]int{{5, 10, 25}}
expected := 0
got := PartOne(input)
if got != expected {
t.Errorf("PartOne() = %d, want %d", got, expected)
}
}
func TestPartTwo(t *testing.T) {
input := [][3]int{
{101, 301, 501},
{102, 302, 502},
{103, 303, 503},
{201, 401, 601},
{202, 402, 602},
{203, 403, 603},
}
expected := 6
got := PartTwo(input)
if got != expected {
t.Errorf("PartTwo() = %d, want %d", got, expected)
}
}