<commit_before>var iiIii = require('../js/i-i-i-i-i');


exports.empty_returns_empty = function(test) {
    test.equal("", iiIii([], ""));
    test.done();
};

exports.space_returns_space = function(test) {
    test.equal(" ", iiIii([], " "));
    test.equal("\n", iiIii([], "\n"));
    test.done();
};

exports.non_special_character_replaced = function(test) {
    test.equal("_", iiIii([], "a"));
    test.equal("_", iiIii([], "5"));
    test.done();
};

exports.replace_multiple_characters = function(test) {
    test.equal("___", iiIii([], "abc"));
    test.done();
};

exports.replace_multiple_characters_with_spaces = function(test) {
    test.equal("  _   __\n__ ", iiIii([], "  a   bc\nde "));
    test.done();
};

exports.does_not_replace_special_character = function(test) {
    test.equal("i", iiIii(['i'], "i"));
    test.done();
};

exports.does_not_replace_special_character_case_insensitive = function(test) {
    test.equal("i I i I I i", iiIii(['i'], "i I i I I i"));
    test.equal("i I i I I i", iiIii(['I'], "i I i I I i"));
    test.done();
};

exports.does_not_replace_special_character_ignore_puctuator = function(test) {
    test.equal("i.I,i-I!I?i'i'\"i\"", iiIii(['i'], "i.I,i-I!I?i'i'\"i\""));
    test.done();
};

exports.does_not_replace_any_special_character = function(test) {
    test.equal("_ b c _", iiIii(['b', 'c'], "a b c d"));
    test.done();
};

exports.special_word = function(test) {
    test.equal("my", iiIii(['my'], "my"));
    test.equal("___", iiIii(['my'], "mmy"));
    test.equal("___", iiIii(['my'], "myy"));
    test.equal("my ___ my", iiIii(['my'], "my xmy my"));
    test.done();
};

exports.special_word_with_spaces = function(test) {
    test.equal("i self", iiIii(['i self'], "i self"));
    test.equal("__ i self __", iiIii(['i self'], "my i self my"));
    test.equal("_ _____", iiIii(['i self'], "i xself"));
    test.equal("_ _____", iiIii(['i self'], "i selfx"));
    test.done();
};

exports.special_word_with_spaces_matches_longest = function(test) {
    test.equal("a b c", iiIii(['a b', 'a b c'], "a b c"));
    test.done();
};<commit_msg>Adding a few more helpers.<commit_after>var iiIii = require('../js/i-i-i-i-i');


exports.empty_returns_empty = function(test) {
    test.equal("", iiIii([], ""));
    test.done();
};

exports.space_returns_space = function(test) {
    test.equal(" ", iiIii([], " "));
    test.equal("\n", iiIii([], "\n"));
    test.done();
};

exports.non_special_character_replaced = function(test) {
    test.equal("_", iiIii([], "a"));
    test.equal("_", iiIii([], "5"));
    test.done();
};

exports.replace_multiple_characters = function(test) {
    test.equal("___", iiIii([], "abc"));
    test.done();
};

exports.replace_multiple_characters_with_spaces = function(test) {
    test.equal("  _   __\n__ ", iiIii([], "  a   bc\nde "));
    test.done();
};

exports.does_not_replace_special_character = function(test) {
    test.equal("i", iiIii(['i'], "i"));
    test.done();
};

exports.does_not_replace_special_character_case_insensitive = function(test) {
    test.equal("i I i I I i", iiIii(['i'], "i I i I I i"));
    test.equal("i I i I I i", iiIii(['I'], "i I i I I i"));
    test.done();
};

exports.does_not_replace_special_character_ignore_puctuator = function(test) {
    test.equal("i.I,i-I!I?i'i'\"i\"", iiIii(['i'], "i.I,i-I!I?i'i'\"i\""));
    test.done();
};

exports.does_not_replace_any_special_character = function(test) {
    test.equal("_ b c _", iiIii(['b', 'c'], "a b c d"));
    test.done();
};

exports.special_word = function(test) {
    test.equal("my", iiIii(['my'], "my"));
    test.equal("___", iiIii(['my'], "mmy"));
    test.equal("___", iiIii(['my'], "myy"));
    test.equal("my ___ my", iiIii(['my'], "my xmy my"));
    test.done();
};

exports.special_word_with_spaces = function(test) {
    test.equal("i self", iiIii(['i self'], "i self"));
    test.equal("__ i self __", iiIii(['i self'], "my i self my"));
    test.equal("_____", iiIii(['i self'], "iself"));
    test.equal("_ _____", iiIii(['i self'], "i xself"));
    test.equal("_ _____", iiIii(['i self'], "i selfx"));
    test.done();
};

exports.special_word_with_spaces_matches_longest = function(test) {
    test.equal("a b c", iiIii(['a b', 'a b c'], "a b c"));
    test.equal("a b c", iiIii(['a b', 'a b c', 'a b c d'], "a b c"));
    test.equal(
        "a b c a b a b _ a b c d _",
        iiIii(['a b', 'a b c', 'a b c d'], "a b c a b a b d a b c d e"));
    test.done();
};
{'fraction_non_alphanumeric': 0.2386490717960188, 'fraction_numerical': 0.00044732721986132855, 'mean_word_length': 3.8293736501079914, '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': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1492057', 'n_tokens_mistral': 1744, 'n_tokens_neox': 1728, 'n_words': 361}