From 7c3a163f9c06c10b221b32dc5d1da99da4641e44 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Sun, 15 May 2016 22:29:32 -0700 Subject: [PATCH] Add back `_.includes` test for strings with a `fromIndex`. --- test/test.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/test/test.js b/test/test.js index 81ab714b4..e45fc7f8f 100644 --- a/test/test.js +++ b/test/test.js @@ -7690,6 +7690,28 @@ assert.deepEqual(actual, expected); }); + QUnit.test('should work with a string and a `fromIndex` >= `string.length`', function(assert) { + assert.expect(1); + + var string = '1234', + length = string.length, + indexes = [4, 6, Math.pow(2, 32), Infinity]; + + var expected = lodashStable.map(indexes, function(index) { + return [false, false, index == length]; + }); + + var actual = lodashStable.map(indexes, function(fromIndex) { + return [ + _.includes(string, 1, fromIndex), + _.includes(string, undefined, fromIndex), + _.includes(string, '', fromIndex) + ]; + }); + + assert.deepEqual(actual, expected); + }); + QUnit.test('should match `NaN`', function(assert) { assert.expect(1);