<commit_before>
var parse = require('..');

describe('parseRange(len, str)', function(){
  it('should parse range strings', function(){
    parse(1000, 'bytes=0-499').should.eql([{ start: 0, end: 499 }]);
    parse(1000, 'bytes=40-80').should.eql([{ start: 40, end: 80 }]);
    parse(1000, 'bytes=-500').should.eql([{ start: 500, end: 999 }]);
    parse(1000, 'bytes=-400').should.eql([{ start: 600, end: 999 }]);
    parse(1000, 'bytes=500-').should.eql([{ start: 500, end: 999 }]);
    parse(1000, 'bytes=400-').should.eql([{ start: 400, end: 999 }]);
    parse(1000, 'bytes=0-0').should.eql([{ start: 0, end: 0 }]);
    parse(1000, 'bytes=-1').should.eql([{ start: 999, end: 999 }]);
  })
})<commit_msg>tests: add test for multiple ranges<commit_after>
var parse = require('..');

describe('parseRange(len, str)', function(){
  it('should parse range strings', function(){
    parse(1000, 'bytes=0-499').should.eql([{ start: 0, end: 499 }]);
    parse(1000, 'bytes=40-80').should.eql([{ start: 40, end: 80 }]);
    parse(1000, 'bytes=-500').should.eql([{ start: 500, end: 999 }]);
    parse(1000, 'bytes=-400').should.eql([{ start: 600, end: 999 }]);
    parse(1000, 'bytes=500-').should.eql([{ start: 500, end: 999 }]);
    parse(1000, 'bytes=400-').should.eql([{ start: 400, end: 999 }]);
    parse(1000, 'bytes=0-0').should.eql([{ start: 0, end: 0 }]);
    parse(1000, 'bytes=-1').should.eql([{ start: 999, end: 999 }]);
    parse(1000, 'bytes=40-80,-1').should.eql([{ start: 40, end: 80 }, { start: 999, end: 999 }]);
  })
})
{'fraction_non_alphanumeric': 0.2584856396866841, 'fraction_numerical': 0.13642297650130547, 'mean_word_length': 4.2320819112627985, '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': '2601846', 'n_tokens_mistral': 737, 'n_tokens_neox': 567, 'n_words': 135}