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

module.exports['dashn'] = {
  "given a function, sends it input line by line": function(test) {
    var actual = [];

    var d = dashn(function(data) {
      actual.push(data.toString());
    });

    d.end("a\nb\nc");

    test.deepEqual(actual, ['a', 'b', 'c']);
    test.done();
  }
};
<commit_msg>extra empty string if input ends with newline<commit_after>var dashn = require('..');

module.exports['dashn'] = {
  "sends function input line by line": function(test) {
    var actual = [];

    var d = dashn(function(data) {
      actual.push(data.toString());
    });

    d.end("a\nb\nc");

    test.deepEqual(actual, ['a', 'b', 'c']);
    test.done();
  },
  "last data chunk is empty string when input ends with newline": function(test) {
    var actual = [];

    var d = dashn(function(data) {
      actual.push(data.toString());
    });

    d.end("a\nb\nc\n");

    test.deepEqual(actual, ['a', 'b', 'c', '']);
    test.done();
  }
};

{'fraction_non_alphanumeric': 0.20686175580222, 'fraction_numerical': 0.0, 'mean_word_length': 2.9365079365079363, 'pattern_counts': {'":': 3, '<': 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': '4064826', 'n_tokens_mistral': 352, 'n_tokens_neox': 341, 'n_words': 80}