Infer sign of range's step when only end is provided.

This commit is contained in:
John-David Dalton
2015-11-25 16:24:47 -07:00
parent 6289211910
commit 70c3d325a0
2 changed files with 17 additions and 5 deletions

View File

@@ -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);