mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-01 07:47:49 +00:00
Add -0 test for math operator methods.
This commit is contained in:
16
test/test.js
16
test/test.js
@@ -19985,6 +19985,22 @@
|
||||
assert.strictEqual(func(undefined, 4), 4);
|
||||
});
|
||||
|
||||
QUnit.test('`_.' + methodName + '` should preserve sign of `0`', function(assert) {
|
||||
assert.expect(2);
|
||||
|
||||
var values = [0, '0', -0, '-0'],
|
||||
expected = [[0, Infinity], ['0', Infinity], [-0, -Infinity], ['-0', -Infinity]];
|
||||
|
||||
lodashStable.times(2, function(index) {
|
||||
var actual = lodashStable.map(values, function(value) {
|
||||
var result = index ? func(undefined, value) : func(value);
|
||||
return [result, 1 / result];
|
||||
});
|
||||
|
||||
assert.deepEqual(actual, expected);
|
||||
});
|
||||
});
|
||||
|
||||
QUnit.test('`_.' + methodName + '` should return an unwrapped value when implicitly chaining', function(assert) {
|
||||
assert.expect(1);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user