test: add unit test
This commit is contained in:
18
2020/day05/main_test.go
Normal file
18
2020/day05/main_test.go
Normal 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)
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user