Ensure _.indexOf and _.lastIndexOf return -1 when performing a binary search for undefined and it's not found. [closes #1303]

This commit is contained in:
jdalton
2015-06-25 14:34:04 -07:00
parent 67359c22d5
commit 6b7c1ad6cf
2 changed files with 5 additions and 5 deletions

View File

@@ -9354,12 +9354,13 @@
deepEqual(actual, expected);
});
test('`_.' + methodName + '` should return `-1` for an unmatched value', 4, function() {
test('`_.' + methodName + '` should return `-1` for an unmatched value', 5, function() {
var array = [1, 2, 3],
empty = [];
strictEqual(func(array, 4), -1);
strictEqual(func(array, 4, true), -1);
strictEqual(func(array, undefined, true), -1);
strictEqual(func(empty, undefined), -1);
strictEqual(func(empty, undefined, true), -1);