mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-08 10:17:48 +00:00
Add tests for parseFloat issues with isIndex and _.set.
This commit is contained in:
12
test/test.js
12
test/test.js
@@ -829,15 +829,16 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
test('should return `false` for non-indexes', 4, function() {
|
test('should return `false` for non-indexes', 5, function() {
|
||||||
if (func) {
|
if (func) {
|
||||||
|
strictEqual(func('1abc'), false);
|
||||||
strictEqual(func(-1), false);
|
strictEqual(func(-1), false);
|
||||||
strictEqual(func(3, 3), false);
|
strictEqual(func(3, 3), false);
|
||||||
strictEqual(func(1.1), false);
|
strictEqual(func(1.1), false);
|
||||||
strictEqual(func(MAX_SAFE_INTEGER), false);
|
strictEqual(func(MAX_SAFE_INTEGER), false);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
skipTest(4);
|
skipTest(5);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}());
|
}());
|
||||||
@@ -14190,6 +14191,13 @@
|
|||||||
|
|
||||||
delete numberProto.a;
|
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 } } });
|
||||||
|
});
|
||||||
}());
|
}());
|
||||||
|
|
||||||
/*--------------------------------------------------------------------------*/
|
/*--------------------------------------------------------------------------*/
|
||||||
|
|||||||
Reference in New Issue
Block a user