mirror of
https://github.com/duke-git/lancet.git
synced 2026-11-16 05:12:11 +08:00
12 lines
259 B
Go
12 lines
259 B
Go
package algorithm
|
|
|
|
import "testing"
|
|
|
|
func TestBinaryIterativeSearchEmpty(t *testing.T) {
|
|
for _, source := range [][]int{nil, {}} {
|
|
if got := BinaryIterativeSearch(source, 1, 0, 0, &intComparator{}); got != -1 {
|
|
t.Errorf("got %d, want -1", got)
|
|
}
|
|
}
|
|
}
|