mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-06 01:47:48 +00:00
Infer sign of range's step when only end is provided.
This commit is contained in:
@@ -15555,12 +15555,18 @@
|
||||
QUnit.module('lodash.range');
|
||||
|
||||
(function() {
|
||||
QUnit.test('should work with an `end` argument', function(assert) {
|
||||
QUnit.test('should work with only an `end` argument', function(assert) {
|
||||
assert.expect(1);
|
||||
|
||||
assert.deepEqual(_.range(4), [0, 1, 2, 3]);
|
||||
});
|
||||
|
||||
QUnit.test('should use a `step` of `-1` when provided only a negative `end` argument', function(assert) {
|
||||
assert.expect(1);
|
||||
|
||||
assert.deepEqual(_.range(-4), [0, -1, -2, -3]);
|
||||
});
|
||||
|
||||
QUnit.test('should work with `start` and `end` arguments', function(assert) {
|
||||
assert.expect(1);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user