test: add unit test for p1
This commit is contained in:
25
internal/2025/DayTwo/code_test.go
Normal file
25
internal/2025/DayTwo/code_test.go
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
package daytwo
|
||||||
|
|
||||||
|
import "testing"
|
||||||
|
|
||||||
|
var testInput = []string{
|
||||||
|
"11-22",
|
||||||
|
"95-115",
|
||||||
|
"998-1012",
|
||||||
|
"1188511880-1188511890",
|
||||||
|
"222220-222224",
|
||||||
|
"1698522-1698528",
|
||||||
|
"446443-446449",
|
||||||
|
"38593856-38593862",
|
||||||
|
"565653-565659",
|
||||||
|
"824824821-824824827",
|
||||||
|
"2121212118-2121212124",
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestPartOne(t *testing.T) {
|
||||||
|
expected := 1227775554
|
||||||
|
got := PartOne(testInput)
|
||||||
|
if got != expected {
|
||||||
|
t.Errorf("PartOne() = %d, want %d", got, expected)
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user