test: add unit test for p1, based on manual calculations

This commit is contained in:
2025-12-01 22:59:05 +01:00
parent fb46fceb75
commit c41c96e628

View File

@@ -0,0 +1,23 @@
package dayseven
import "testing"
var testInput = []string{
"123 -> x",
"456 -> y",
"x AND y -> d",
"x OR y -> e",
"x LSHIFT 2 -> f",
"y RSHIFT 2 -> g",
"NOT x -> h",
"NOT y -> i",
"d -> a",
}
func TestPartOne(t *testing.T) {
expected := 72
got := PartOne(testInput)
if got != expected {
t.Errorf("PartOne() = %d, want %d", got, expected)
}
}