<commit_before>test('convertArgsString', function(){
    var argsString = '{Object|String}events, {String}[selector], {*}[data], {Function}fn',
        argsArray = {
            length: 4,
            requiredLength: 2,
            0: {types: ['object', 'string'], mixed: false, required: true},
            1: {types: ['string'], mixed: false, required: false},
            2: {types: [], mixed: true, required: false},
            3: {types: ['function'], mixed: false, required: true}
        };

    equal(JSON.stringify(Overload.convertArgsString(argsString)), JSON.stringify(argsArray));
});

test('getCorrectArguments', function(){
    var argsOps = Overload.convertArgsString('{String}events, {Object|String}[selector], {*}[data], {Function}fn');

    var check = function(){
        var args = Overload.getCorrectArguments(arguments, argsOps);

        for(var i = 0; i < args.length; i++) {
            args[i] = typeof args[i];
        }

        return args.join(', ');
    };

    equal(check('', {}, '', function(){}), 'string, object, string, function');
    equal(check('', {}, function(){}),     'string, object, undefined, function');
    equal(check('', 1, function(){}),      'string, undefined, number, function');
    equal(check('', function(){}),         'string, undefined, undefined, function');

    equal(check('', '', '', function(){}), 'string, string, string, function');
    equal(check('', '', {}, function(){}), 'string, string, object, function');
    equal(check('', '', function(){}),     'string, string, undefined, function');

    equal(check('', function(){}, function(){}), 'string, undefined, function, function');

    equal(check('', function(){}, '', '', function(){}, ''), 'string, undefined, function, string');

});

test('Overload', function(){
    var obj = {
        func: Overload('{Object|String}event, {String}[selector], {*}[data], {Function}fn', function(event, selector, data, fn){
            ok(this === obj);
            ok(typeof event === 'object' || typeof event === 'string');
            ok(typeof selector === 'undefined');
            ok(typeof data !== 'undefined');
            ok(typeof fn === 'function');
        })
    };

    obj.func('', 1, function(){});
});<commit_msg>using deepEqual instead of JSON.stringify<commit_after>test('convertArgsString', function(){
    var argsString = '{Object|String}events, {String}[selector], {*}[data], {Function}fn',
        argsArray = {
            length: 4,
            requiredLength: 2,
            0: {types: ['object', 'string'], mixed: false, required: true},
            1: {types: ['string'], mixed: false, required: false},
            2: {types: [], mixed: true, required: false},
            3: {types: ['function'], mixed: false, required: true}
        };

    deepEqual(Overload.convertArgsString(argsString), argsArray);
});

test('getCorrectArguments', function(){
    var argsOps = Overload.convertArgsString('{String}events, {Object|String}[selector], {*}[data], {Function}fn');

    var check = function(){
        var args = Overload.getCorrectArguments(arguments, argsOps);

        for(var i = 0; i < args.length; i++) {
            args[i] = typeof args[i];
        }

        return args.join(', ');
    };

    equal(check('', {}, '', function(){}), 'string, object, string, function');
    equal(check('', {}, function(){}),     'string, object, undefined, function');
    equal(check('', 1, function(){}),      'string, undefined, number, function');
    equal(check('', function(){}),         'string, undefined, undefined, function');

    equal(check('', '', '', function(){}), 'string, string, string, function');
    equal(check('', '', {}, function(){}), 'string, string, object, function');
    equal(check('', '', function(){}),     'string, string, undefined, function');

    equal(check('', function(){}, function(){}), 'string, undefined, function, function');

    equal(check('', function(){}, '', '', function(){}, ''), 'string, undefined, function, string');

});

test('Overload', function(){
    var obj = {
        func: Overload('{Object|String}event, {String}[selector], {*}[data], {Function}fn', function(event, selector, data, fn){
            ok(this === obj);
            ok(typeof event === 'object' || typeof event === 'string');
            ok(typeof selector === 'undefined');
            ok(typeof data !== 'undefined');
            ok(typeof fn === 'function');
        })
    };

    obj.func('', 1, function(){});
});

{'fraction_non_alphanumeric': 0.214238042269188, 'fraction_numerical': 0.004004449388209121, 'mean_word_length': 3.3439613526570047, 'pattern_counts': {'":': 0, '<': 5, '<?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': '2428314', 'n_tokens_mistral': 1266, 'n_tokens_neox': 1205, 'n_words': 322}