<commit_before>var P = require('../prelude').install(GLOBAL);
var assert = map(flip, require('assert'));

describe('Data.List', function () {

    it('heads', function () {

    });

    it('heads /w string', function () {

    });

    it('tails', function () {

    });

    it('tails /w string', function () {

    });

    it('inits', function () {

    });

    it('inits /w string', function () {

    });

    it('lasts', function () {

    });

    it('lasts /w string', function () {

    });

    it('partition', function () {
        assert.deepEqual(
            [ [ 0, -3, -3, -10 ], [ 4, 5, 14 ] ],
            partition(gte(0), [ 0, -3, 4, 5, -3, -10, 14 ])
        );
    });

    it('partition /w string', function () {
        assert.deepEqual(
            [ " ", "HelloWorld!" ],
            partition(function isSpace(chr) {
                return chr === ' ';
            }, "Hello World!")
        );
    });

    it('transpose', function () {
        assert.deepEqual(
            [ ['a', 'd', 'f'], ['b', 'e', 'g'], ['c', 'h'], ['i'] ],
            transpose([ ['a', 'b', 'c'], ['d', 'e'], ['f', 'g', 'h', 'i' ] ])
        );
    });

    it('transpose /w string', function () {
        assert.deepEqual(
            [ "adf", "beg", "ch", "i" ],
            transpose([ "abc", "de", "fghi" ])
        );
    });

    it('group', function () {
        assert.deepEqual(
            [ ['H'], ['e'], ['l', 'l'], ['o'], [' '],
              ['W'], ['o'], ['r'], ['l'], ['d'], ['!']],
            group(['H', 'e', 'l' ,'l', 'o', ' ', 'W', 'o', 'r', 'l', 'd', '!'])
        );
        assert.deepEqual([], groupBy(neq, []));
    });

    it('group /w string', function () {
        assert.deepEqual(
            [ "H", "e", "ll", "o", " ", "W", "o", "r", "l", "d", "!" ],
            group("Hello World!")
        );
        assert.deepEqual([], groupBy(neq, []));
    });

    it('maximumBy', function () {
        var list = [2, 10, 5, 8, 21, 1, 9, 8, 3];
        assert.strictEqual(minimum(list), maximumBy(compose2(negate, compare), list));
    });

    it('minimumBy', function () {
        var list = [2, 10, 5, 8, 21, 1, 9, 8, 3];
        assert.strictEqual(maximum(list), minimumBy(compose2(negate, compare), list));
    });

    it('sort', function () {
        assert.deepEqual([], sort([]));
        assert.deepEqual([{}], sort([{}]));
    });

    it('sort /w list of numbers', function () {
        assert.deepEqual([1,2,3,4,10,15,20], sort([4,20,2,10,3,15,1]));
    });

    it('sort /w list of strings', function () {
        assert.deepEqual(
            ["Amdahl", "Babbage", "Church", "Curry", "Dijkstra", "Eich",
             "Feynman", "Floyd", "Gosling", "Graham", "Gödel", "Hamming",
             "Hoare", "Hollerith", "Hopper", "Huffman", "Hughes", "Ichbiah",
             "Joy", "Karp", "Kay", "Kleene", "Knuth", "Kolmogorov",
             "Kruskal", "Lamport", "Liskov", "Lovelace", "McCarthy",
             "Milner", "Moore", "Naur", "Neumann", "Parnas", "<NAME>",
             "Rabin", "Ritchie", "Shamir", "Shannon", "Steele", "Thompson",
             "Torvalds", "Turing", "Ullman", "Weizenbaum", "Wheeler",
             "Wijngaarden", "Wirth", "Zuse" ],
            sort([
                "Curry", "Hughes", "Huffman", "Lovelace", "Steele", "Ullman",
                "Hopper", "Joy", "Kay", "Karp", "Kolmogorov", "Rabin", "Shamir",
                "Dijkstra", "Feynman", "Hamming", "Liskov", "Naur", "Shannon",
                "Church", "Floyd", "Ichbiah", "Knuth", "Neumann", "Ritchie",
                "Weizenbaum", "Thompson", "Turing", "Torvalds", "Wijngaarden",
                "Eich", "Gödel", "Hollerith", "Hoare", "Moore", "Parnas", "Zuse",
                "Amdahl", "Gosling", "Kleene", "Lamport", "<NAME>", "Wirth",<commit_msg>localeCompare is different between Node v0.10/iojs and Node v0.11+<commit_after>var P = require('../prelude').install(GLOBAL);
var assert = map(flip, require('assert'));

describe('Data.List', function () {

    it('heads', function () {

    });

    it('heads /w string', function () {

    });

    it('tails', function () {

    });

    it('tails /w string', function () {

    });

    it('inits', function () {

    });

    it('inits /w string', function () {

    });

    it('lasts', function () {

    });

    it('lasts /w string', function () {

    });

    it('partition', function () {
        assert.deepEqual(
            [ [ 0, -3, -3, -10 ], [ 4, 5, 14 ] ],
            partition(gte(0), [ 0, -3, 4, 5, -3, -10, 14 ])
        );
    });

    it('partition /w string', function () {
        assert.deepEqual(
            [ " ", "HelloWorld!" ],
            partition(function isSpace(chr) {
                return chr === ' ';
            }, "Hello World!")
        );
    });

    it('transpose', function () {
        assert.deepEqual(
            [ ['a', 'd', 'f'], ['b', 'e', 'g'], ['c', 'h'], ['i'] ],
            transpose([ ['a', 'b', 'c'], ['d', 'e'], ['f', 'g', 'h', 'i' ] ])
        );
    });

    it('transpose /w string', function () {
        assert.deepEqual(
            [ "adf", "beg", "ch", "i" ],
            transpose([ "abc", "de", "fghi" ])
        );
    });

    it('group', function () {
        assert.deepEqual(
            [ ['H'], ['e'], ['l', 'l'], ['o'], [' '],
              ['W'], ['o'], ['r'], ['l'], ['d'], ['!']],
            group(['H', 'e', 'l' ,'l', 'o', ' ', 'W', 'o', 'r', 'l', 'd', '!'])
        );
        assert.deepEqual([], groupBy(neq, []));
    });

    it('group /w string', function () {
        assert.deepEqual(
            [ "H", "e", "ll", "o", " ", "W", "o", "r", "l", "d", "!" ],
            group("Hello World!")
        );
        assert.deepEqual([], groupBy(neq, []));
    });

    it('maximumBy', function () {
        var list = [2, 10, 5, 8, 21, 1, 9, 8, 3];
        assert.strictEqual(minimum(list), maximumBy(compose2(negate, compare), list));
    });

    it('minimumBy', function () {
        var list = [2, 10, 5, 8, 21, 1, 9, 8, 3];
        assert.strictEqual(maximum(list), minimumBy(compose2(negate, compare), list));
    });

    it('sort', function () {
        assert.deepEqual([], sort([]));
        assert.deepEqual([{}], sort([{}]));
    });

    it('sort /w list of numbers', function () {
        assert.deepEqual([1,2,3,4,10,15,20], sort([4,20,2,10,3,15,1]));
    });

    it('sort /w list of strings', function () {
        assert.deepEqual(
            ["Amdahl", "Babbage", "Church", "Curry", "Dijkstra", "Eich",
             "Feynman", "Floyd", "Gosling", "Graham", "Hamming",
             "Hoare", "Hollerith", "Hopper", "Huffman", "Hughes", "Ichbiah",
             "Joy", "Karp", "Kay", "Kleene", "Knuth", "Kolmogorov",
             "Kruskal", "Lamport", "Liskov", "Lovelace", "McCarthy",
             "Milner", "Moore", "Naur", "Neumann", "Parnas", "<NAME>",
             "Rabin", "Ritchie", "Shamir", "Shannon", "Steele", "Thompson",
             "Torvalds", "Turing", "Ullman", "Weizenbaum", "Wheeler",
             "Wijngaarden", "Wirth", "Zuse" ],
            sort([
                "Curry", "Hughes", "Huffman", "Lovelace", "Steele", "Ullman",
                "Hopper", "Joy", "Kay", "Karp", "Kolmogorov", "Rabin", "Shamir",
                "Dijkstra", "Feynman", "Hamming", "Liskov", "Naur", "Shannon",
                "Church", "Floyd", "Ichbiah", "Knuth", "Neumann", "Ritchie",
                "Weizenbaum", "Thompson", "Turing", "Torvalds", "Wijngaarden",
                "Eich", "Hollerith", "Hoare", "Moore", "Parnas", "Zuse",
                "Amdahl", "Gosling", "Kleene", "Lamport", "<NAME>", "Wirth",
{'fraction_non_alphanumeric': 0.251939513477975, 'fraction_numerical': 0.01735700197238659, 'mean_word_length': 2.137788778877888, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '4356520', 'n_tokens_mistral': 2896, 'n_tokens_neox': 2649, 'n_words': 583}