mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-05 09:27:49 +00:00
Ensure _.toInteger can return -0.
This commit is contained in:
@@ -19063,6 +19063,12 @@
|
||||
assert.strictEqual(_.toInteger(Infinity), MAX_INTEGER);
|
||||
assert.strictEqual(_.toInteger(-Infinity), -MAX_INTEGER);
|
||||
});
|
||||
|
||||
QUnit.test('should not coerce `-0` to `0`', function(assert) {
|
||||
assert.expect(1);
|
||||
|
||||
assert.strictEqual(1 / _.toInteger(-0), -Infinity);
|
||||
});
|
||||
}());
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
Reference in New Issue
Block a user