<commit_before>describe("CSVParser", function() {
  var parser, data, fieldSeparator;

  describe("output", function(){
    beforeEach(function(){
      data = ['url,username,password,extra,name,grouping,fav', 'https://www.example.com,username,password,,example.com,,1', ',,,,,,'].join("\r\n");
    });
    it("should exclude empty rows by default", function(){
      parser = new CSVParser(data);
      parser.parse();
      expect(parser.numberOfRows()).toEqual(2);
    });
    it("should exclude empty rows with explicit true option", function(){
      parser = new CSVParser(data, {ignoreEmpty: true});
      parser.parse();
      expect(parser.numberOfRows()).toEqual(2);
    });
    it("should not exclude empty rows with explicit false option", function(){
      parser = new CSVParser(data, {ignoreEmpty: false});
      parser.parse();
      expect(parser.numberOfRows()).toEqual(3);
    });
  });

  describe("separators", function(){
    beforeEach(function(){
      data = ['url,"username",password,extra,name,grouping,fav', 'https://www.example.com,myUsername,"abcdé""4j+<+G9\n3$6,6,+z:(b?g\\",,example.com,,1'].join("\r\n");
      parser = new CSVParser(data);
    });

    it("uses comma as the default field separator", function(){
      expect(parser.fieldSeparator).toEqual(",");<commit_msg>100% code coverage<commit_after>describe("CSVParser", function() {
  var parser, data, fieldSeparator;
  describe("behavior", function(){
    it("should report its object type properly", function(){
      parser = new CSVParser("some,data,here\nin,two,lines");
      expect(parser.toString()).toEqual("[object CSVParser]");
    });
  });
  describe("output", function(){
    beforeEach(function(){
      data = ['url,username,password,extra,name,grouping,fav', 'https://www.example.com,username,password,,example.com,,1', ',,,,,,'].join("\r\n");
    });
    it("should exclude empty rows by default", function(){
      parser = new CSVParser(data);
      parser.parse();
      expect(parser.numberOfRows()).toEqual(2);
    });
    it("should exclude empty rows with explicit true option", function(){
      parser = new CSVParser(data, {ignoreEmpty: true});
      parser.parse();
      expect(parser.numberOfRows()).toEqual(2);
    });
    it("should not exclude empty rows with explicit false option", function(){
      parser = new CSVParser(data, {ignoreEmpty: false});
      parser.parse();
      expect(parser.numberOfRows()).toEqual(3);
    });
  });

  describe("separators", function(){
    beforeEach(function(){
      data = ['url,"username",password,extra,name,grouping,fav', 'https://www.example.com,myUsername,"abcdé""4j+<+G9\n3$6,6,+z:(b?g\\",,example.com,,1'].join("\r\n");
      parser = new CSVParser(data);
    });

    it("uses comma as the default field separator", function(){
      expect(parser.fieldSeparator).toEqual(",");
{'fraction_non_alphanumeric': 0.19089316987740806, 'fraction_numerical': 0.008056042031523642, 'mean_word_length': 4.211678832116788, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 4, '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': '1653142', 'n_tokens_mistral': 855, 'n_tokens_neox': 852, 'n_words': 167}