<commit_before>var range = require('./index.js')
  , assert = require('assert');

describe("Range", function () {
  describe("rejects", function () {
    it("non-strings", function () {
      assert.deepEqual( range(null), [] );
      assert.deepEqual( range(NaN),  [] );
      assert.deepEqual( range({}),   [] );
      assert.deepEqual( range([]),   [] );
      assert.deepEqual( range(123),  [] );
    });

    it("invalid formats", function () {
      assert.deepEqual( range(""),              [] );
      assert.deepEqual( range("foobar"),        [] );
      assert.deepEqual( range("-1--10"),        [] );
      assert.deepEqual( range("12..14x"),       [] );
      assert.deepEqual( range("1,2,,3"),        [] );
      assert.deepEqual( range("1,2,3,1..2x-3"), [] );
    });
  });

  describe("works for", function () {
    it("single number", function () {
      assert.deepEqual( range("1"),     [1] );
      assert.deepEqual( range("10"),    [10] );
      assert.deepEqual( range("00003"), [3] );
      assert.deepEqual( range("90210"), [90210] );
    });

    it("negative number", function () {
      assert.deepEqual( range("-1"),     [-1] );
      assert.deepEqual( range("-123"),   [-123] );
      assert.deepEqual( range("-00000"), [0] );
    });

    it("multiple numbers", function () {
      assert.deepEqual( range("1,2,3"),    [1,2,3] );
      assert.deepEqual( range("10,2,-3"),  [10,2,-3] );
      assert.deepEqual( range("10,10,10"), [10,10,10] );
    });

    it("single range", function () {
      assert.deepEqual( range("1..3"),  [1,2,3] );
      assert.deepEqual( range("10..3"), [10,9,8,7,6,5,4,3] );
      assert.deepEqual( range("0..0"),  [0] );
    });

    it("single range, one negative", function () {
      assert.deepEqual( range("-1..3"), [-1,0,1,2,3] );
      assert.deepEqual( range("-5..0"), [-5,-4,-3,-2,-1,0] );
      assert.deepEqual( range("1..-3"), [1,0,-1,-2,-3] );
    });

    it("single range, both negative", function () {
      assert.deepEqual( range("-1..-3"),         [-1,-2,-3] );
      assert.deepEqual( range("-5..-1"),         [-5,-4,-3,-2,-1] );
      assert.deepEqual( range("-26379..-26379"), [-26379] );
    });

    it("multiple ranges", function () {
      assert.deepEqual( range("-1..-3,1..3"),    [-1,-2,-3,1,2,3] );
      assert.deepEqual( range("-5..0,4"),        [-5,-4,-3,-2,-1,0,4] );
      assert.deepEqual( range("2..2,2..2,2..2"), [2,2,2] );
    });

    it("single steps", function () {
      assert.deepEqual( range("1..5x2"),  [1,3,5] );
      assert.deepEqual( range("2..10x3"), [2,5,8] );
      assert.deepEqual( range("10..1x2"), [10,8,6,4,2] );
    });

    it("single step, one negative", function () {
      assert.deepEqual( range("-5..4x3"),  [-5,-2,1,4] );
      assert.deepEqual( range("5..-18x5"),  [5,0,-5,-10,-15] );
    });

    it("single step, both negative", function () {
      assert.deepEqual( range("-5..-13x2"),  [-5,-7,-9,-11,-13] );
      assert.deepEqual( range("-15..-7x1"),  [-15,-14,-13,-12,-11,-10,-9,-8,-7] );
    });

    it("multiple steps", function () {
      assert.deepEqual( range("-5..-13x2,1..8x3"),  [-5,-7,-9,-11,-13,1,4,7] );
    });

    it("ignores whitespace", function () {
      assert.deepEqual( range("  -5 .. -13 x   \t    2 , 1 .. \n   8 x 3      "),  [-5,-7,-9,-11,-13,1,4,7] );
    });
  });
});
<commit_msg>Don't use deprecated assert method<commit_after>var range = require('./index.js')
  , assert = require('assert');

describe("Range", function () {
  describe("rejects", function () {
    it("non-strings", function () {
      assert.deepStrictEqual( range(null), [] );
      assert.deepStrictEqual( range(NaN),  [] );
      assert.deepStrictEqual( range({}),   [] );
      assert.deepStrictEqual( range([]),   [] );
      assert.deepStrictEqual( range(123),  [] );
    });

    it("invalid formats", function () {
      assert.deepStrictEqual( range(""),              [] );
      assert.deepStrictEqual( range("foobar"),        [] );
      assert.deepStrictEqual( range("-1--10"),        [] );
      assert.deepStrictEqual( range("12..14x"),       [] );
      assert.deepStrictEqual( range("1,2,,3"),        [] );
      assert.deepStrictEqual( range("1,2,3,1..2x-3"), [] );
    });
  });

  describe("works for", function () {
    it("single number", function () {
      assert.deepStrictEqual( range("1"),     [1] );
      assert.deepStrictEqual( range("10"),    [10] );
      assert.deepStrictEqual( range("00003"), [3] );
      assert.deepStrictEqual( range("90210"), [90210] );
    });

    it("negative number", function () {
      assert.deepStrictEqual( range("-1"),     [-1] );
      assert.deepStrictEqual( range("-123"),   [-123] );
      assert.deepStrictEqual( range("-00000"), [-0] );
    });

    it("multiple numbers", function () {
      assert.deepStrictEqual( range("1,2,3"),    [1,2,3] );
      assert.deepStrictEqual( range("10,2,-3"),  [10,2,-3] );
      assert.deepStrictEqual( range("10,10,10"), [10,10,10] );
    });

    it("single range", function () {
      assert.deepStrictEqual( range("1..3"),  [1,2,3] );
      assert.deepStrictEqual( range("10..3"), [10,9,8,7,6,5,4,3] );
      assert.deepStrictEqual( range("0..0"),  [0] );
    });

    it("single range, one negative", function () {
      assert.deepStrictEqual( range("-1..3"), [-1,0,1,2,3] );
      assert.deepStrictEqual( range("-5..0"), [-5,-4,-3,-2,-1,0] );
      assert.deepStrictEqual( range("1..-3"), [1,0,-1,-2,-3] );
    });

    it("single range, both negative", function () {
      assert.deepStrictEqual( range("-1..-3"),         [-1,-2,-3] );
      assert.deepStrictEqual( range("-5..-1"),         [-5,-4,-3,-2,-1] );
      assert.deepStrictEqual( range("-26379..-26379"), [-26379] );
    });

    it("multiple ranges", function () {
      assert.deepStrictEqual( range("-1..-3,1..3"),    [-1,-2,-3,1,2,3] );
      assert.deepStrictEqual( range("-5..0,4"),        [-5,-4,-3,-2,-1,0,4] );
      assert.deepStrictEqual( range("2..2,2..2,2..2"), [2,2,2] );
    });

    it("single steps", function () {
      assert.deepStrictEqual( range("1..5x2"),  [1,3,5] );
      assert.deepStrictEqual( range("2..10x3"), [2,5,8] );
      assert.deepStrictEqual( range("10..1x2"), [10,8,6,4,2] );
    });

    it("single step, one negative", function () {
      assert.deepStrictEqual( range("-5..4x3"),  [-5,-2,1,4] );
      assert.deepStrictEqual( range("5..-18x5"),  [5,0,-5,-10,-15] );
    });

    it("single step, both negative", function () {
      assert.deepStrictEqual( range("-5..-13x2"),  [-5,-7,-9,-11,-13] );
      assert.deepStrictEqual( range("-15..-7x1"),  [-15,-14,-13,-12,-11,-10,-9,-8,-7] );
    });

    it("multiple steps", function () {
      assert.deepStrictEqual( range("-5..-13x2,1..8x3"),  [-5,-7,-9,-11,-13,1,4,7] );
    });

    it("ignores whitespace", function () {
      assert.deepStrictEqual( range("  -5 .. -13 x   \t    2 , 1 .. \n   8 x 3      "),  [-5,-7,-9,-11,-13,1,4,7] );
    });
  });
});

{'fraction_non_alphanumeric': 0.2593444508338125, 'fraction_numerical': 0.0816561242093157, 'mean_word_length': 2.5100908173562058, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2412863', 'n_tokens_mistral': 2688, 'n_tokens_neox': 2549, 'n_words': 376}