aoc/2023/09/part2/part2/part2_test.go
2023-12-09 13:02:51 +00:00

20 lines
307 B
Go

package part2
import (
"testing"
"reflect"
)
func TestPrev(t *testing.T) {
next, err := Next([]int{0,1,2,3}, true)
equal(t,err,nil)
equal(t,next,-1)
}
func equal(t *testing.T, actual any, target any) {
if !reflect.DeepEqual(actual, target) {
t.Errorf("expected %v, got %v", target, actual)
}
}