mirror of
https://github.com/duke-git/lancet.git
synced 2026-11-16 05:12:11 +08:00
fix(package): [algorithm] handle empty iterative searches (#399)
This commit is contained in:
1 parent
13b7b1c61e
commit
e49a01e725
2 files changed
+14
No files matched your search
@@ -0,0 +1,11 @@
|
||||
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)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user