summaryrefslogtreecommitdiff
path: root/deps/npm/node_modules/minimatch/node_modules/brace-expansion/test/negative-increment.js
blob: 8d434c23d4514dc015095bd3422840795a046296 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
var test = require('tape');
var expand = require('..');

test('negative increment', function(t) {
  t.deepEqual(expand('{3..1}'), ['3', '2', '1']);
  t.deepEqual(expand('{10..8}'), ['10', '9', '8']);
  t.deepEqual(expand('{10..08}'), ['10', '09', '08']);
  t.deepEqual(expand('{c..a}'), ['c', 'b', 'a']);

  t.deepEqual(expand('{4..0..2}'), ['4', '2', '0']);
  t.deepEqual(expand('{4..0..-2}'), ['4', '2', '0']);
  t.deepEqual(expand('{e..a..2}'), ['e', 'c', 'a']);

  t.end();
});