test: add unit test

This commit is contained in:
2025-11-24 21:07:43 +01:00
parent 624649e6ea
commit 3602fc356b

18
2020/day05/main_test.go Normal file
View File

@@ -0,0 +1,18 @@
package main
import "testing"
var testInput = []string{
"FBFBBFFRLR",
"BFFFBBFRRR",
"FFFBBBFRRR",
"BBFFBBFRLL",
}
func TestPartOne(t *testing.T) {
expected := 820
got := PartOne(testInput)
if got != expected {
t.Errorf("PartOne() = %d, want %d", got, expected)
}
}