Add tests for parseFloat issues with isIndex and _.set.

This commit is contained in:
Chris Hiestand
2015-05-24 23:31:44 -07:00
committed by jdalton
parent daa8428b32
commit b309b507eb

View File

@@ -829,15 +829,16 @@
}
});
test('should return `false` for non-indexes', 4, function() {
test('should return `false` for non-indexes', 5, function() {
if (func) {
strictEqual(func('1abc'), false);
strictEqual(func(-1), false);
strictEqual(func(3, 3), false);
strictEqual(func(1.1), false);
strictEqual(func(MAX_SAFE_INTEGER), false);
}
else {
skipTest(4);
skipTest(5);
}
});
}());
@@ -14190,6 +14191,13 @@
delete numberProto.a;
});
test('should not create an array for missing non-index property names that start with numbers', 1, function() {
var object = {};
_.set(object, ['1a', '2b', '3c'], 1);
deepEqual(object, { '1a': { '2b': { '3c': 1 } } });
});
}());
/*--------------------------------------------------------------------------*/