From 60c89b275426eae1f81d3de06421578beaab3adc Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Tue, 19 Apr 2016 12:37:47 -0700 Subject: [PATCH] Add `_.invoke` test for `-0` key. --- test/test.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/test/test.js b/test/test.js index 19b4d1235..275d67458 100644 --- a/test/test.js +++ b/test/test.js @@ -8173,6 +8173,19 @@ assert.deepEqual(actual, expected); }); + QUnit.test('should preserve the sign of `0`', function(assert) { + assert.expect(1); + + var object = { '-0': alwaysA, '0': alwaysB }, + props = [-0, Object(-0), 0, Object(0)]; + + var actual = lodashStable.map(props, function(key) { + return _.invoke(object, key); + }); + + assert.deepEqual(actual, ['a', 'a', 'b', 'b']); + }); + QUnit.test('should support deep paths', function(assert) { assert.expect(2);