test: add P1 unit test
This commit is contained in:
17
internal/2022/DayTwo/code_test.go
Normal file
17
internal/2022/DayTwo/code_test.go
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
package daytwo
|
||||||
|
|
||||||
|
import "testing"
|
||||||
|
|
||||||
|
var testInput = []string{
|
||||||
|
"A Y",
|
||||||
|
"B X",
|
||||||
|
"C Z",
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestPartOne(t *testing.T) {
|
||||||
|
expected := 15
|
||||||
|
got := PartOne(testInput)
|
||||||
|
if got != expected {
|
||||||
|
t.Errorf("PartOne() = %d, want %d", got, expected)
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user