test: add unit test for part one
This commit is contained in:
20
internal/2022/DayThree/code_test.go
Normal file
20
internal/2022/DayThree/code_test.go
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
package daythree
|
||||||
|
|
||||||
|
import "testing"
|
||||||
|
|
||||||
|
var testInput = []string{
|
||||||
|
"vJrwpWtwJgWrhcsFMMfFFhFp",
|
||||||
|
"jqHRNqRjqzjGDLGLrsFMfFZSrLrFZsSL",
|
||||||
|
"PmmdzqPrVvPwwTWBwg",
|
||||||
|
"wMqvLMZHhHMvwLHjbvcjnnSBnvTQFn",
|
||||||
|
"ttgJtRGJQctTZtZT",
|
||||||
|
"CrZsJsPPZsGzwwsLwLmpwMDw",
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestPartOne(t *testing.T) {
|
||||||
|
expected := 157
|
||||||
|
got := PartOne(testInput)
|
||||||
|
if got != expected {
|
||||||
|
t.Errorf("PartOne() = %d, want %d", got, expected)
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user