mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-04 08:57:49 +00:00
Ensure min and max of _.random are swapped if min > max.
This commit is contained in:
14
test/test.js
14
test/test.js
@@ -15407,6 +15407,20 @@
|
||||
}));
|
||||
});
|
||||
|
||||
QUnit.test('should swap `min` and `max` when `min` > `max`', function(assert) {
|
||||
assert.expect(1);
|
||||
|
||||
var min = 4,
|
||||
max = 2,
|
||||
expected = [2, 3, 4];
|
||||
|
||||
var actual = lodashStable.uniq(lodashStable.map(array, function() {
|
||||
return _.random(min, max);
|
||||
})).sort();
|
||||
|
||||
assert.deepEqual(actual, expected);
|
||||
});
|
||||
|
||||
QUnit.test('should support large integer values', function(assert) {
|
||||
assert.expect(2);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user