<commit_before>//- JavaScript source code

//- tests.js ~~
//
//  I wrote these tests for use with PhantomJS because I am sick of typing them
//  out over and over in the Chrome console. It's close enough to using Node.js
//  that I lied to JSLint about it, hehe.
//
//                                                      ~~ (c) SRW, 28 Nov 2012
//                                                  ~~ last updated 14 Jan 2013

(function () {
    'use strict';

 // Pragmas

    /*jslint indent: 4, maxlen: 80, node: true */

 // Declarations

    var mothership, run_test;

 // Definitions

    mothership = 'http://localhost:8177';

    run_test = function (y, f) {
     // This function needs documentation.
        var homepage = require('webpage').create();
        homepage.onConsoleMessage = function (message) {
         // This function needs documentation.
            console.log(message);
            if (message === y) {
                homepage.close();
                setTimeout(phantom.exit, 0);
            }
            if (message.slice(6) === 'Error:') {
                setTimeout(phantom.exit, 0, 1);
            }
            return;
        };
        homepage.onError = function (message) {
         // This function needs documentation.
            console.error('Error:', message);
            setTimeout(phantom.exit, 0, 1);
            return;
        };
        homepage.onResourceReceived = function (response) {
         // This function needs documentation.
            return;
        };
        homepage.onResourceRequested = function (request) {
         // This function needs documentation.
            console.log(request.method, request.url);
            return;
        };
        homepage.open(mothership, function (status) {
         // This function needs documentation.
            if (status !== 'success') {
                console.error('Something went wrong:', status);
                return phantom.exit(1);
            }
            console.log('Running test ...');
            homepage.evaluate(f);
            return;
        });
        return;
    };

 // Invocations

    console.log('NOTE: Remember to launch a worker for "sean"!');

    run_test('Results: 4', function () {
     // This function needs documentation.
        var x = window.QM.avar({box: 'sean', val: 2});
        x.Q(function (evt) {
         // This function needs documentation.
            this.val += 2;
            return evt.exit();
        }).Q(function (evt) {
         // This function needs documentation.
            console.log('Results:', this.val);
            return evt.exit();
        }).on('error', function (message) {
         // This function needs documentation.
            console.error('Error:', message);
            return;
        });
        return;
    });

 // That's all, folks!

    return;
<commit_msg>Added CoffeeScript `submit` method tests<commit_after>//- JavaScript source code

//- tests.js ~~
//
//  I wrote these tests for use with PhantomJS because I am sick of typing them
//  out over and over in the Chrome console. It's close enough to using Node.js
//  that I lied to JSLint about it, hehe.
//
//  NOTE: I need to rewrite this junk so it uses Quanah ...
//
//                                                      ~~ (c) SRW, 28 Nov 2012
//                                                  ~~ last updated 16 Jan 2013

(function () {
    'use strict';

 // Pragmas

    /*jslint indent: 4, maxlen: 80, node: true */

 // Declarations

    var exit, mothership, n, run_test;

 // Definitions

    exit = function (code) {
     // This function needs documentation.
        /*global phantom: false */
        n -= 1;
        if (n === 0) {
            setTimeout(phantom.exit, 0, code);
        }
        return;
    };

    mothership = 'http://localhost:8177';

    n = 6;

    run_test = function (y, f) {
     // This function needs documentation.
        var homepage = require('webpage').create();
        homepage.onConsoleMessage = function (message) {
         // This function needs documentation.
            console.log(message);
            if (message === y) {
                homepage.close();
                exit(0);
            }
            if (message.slice(6) === 'Error:') {
                exit(1);
            }
            return;
        };
        homepage.onError = function (message) {
         // This function needs documentation.
            console.error('Error:', message);
            exit(1);
            return;
        };
        homepage.onResourceReceived = function (response) {
         // This function needs documentation.
            return;
        };
        homepage.onResourceRequested = function (request) {
         // This function needs documentation.
            //console.log(request.method, request.url);
            return;
        };
        homepage.open(mothership, function (status) {
         // This function needs documentation.
            if (status !== 'success') {
                console.error('Something went wrong:', status);
                return exit(1);
            }
            console.log('Running test ...');
            homepage.evaluate(f);
            return;
        });
        return;
    };

 // Invocations

    console.log('NOTE: Remember to launch a worker for "sean"!');

    run_test('Results: 1', function () {
     // This function needs documentation.
        /*jslint browser: true */
        var x = window.QM.avar({box: 'sean', val: 0});
        x.Q(function (evt) {
         // This function needs documentation.
            this.val += 1;
            return evt.exit();
        }).Q(function (evt) {
         // This function needs documentation.
            console.log('Results:', this.val);
            return evt.exit();
        }).on('error', function (message) {
         // This function needs documentation.
            console.error('Error:', message);
            return;
        });
        return;
    });

    run_test('Results: 2', function () {
     // This function needs documentation.
        /*jslint browser: true */
        var x = window.QM.avar();
        x.box = 'sean';
        x.val = 0;
        x.Q(function (evt) {
         // This function needs documentation.
            this.val += 2;
            return evt.exit();
        }).Q(function (evt) {
         // This function needs documentation.
            console.log('Results:', this.val);
            return evt.exit();
        }).on('error', function (message) {
         // This function needs documentation.
            console.error('Error:', message);
            return;
        });
        return;
    });

    run_test('Results: 3', function () {
     // This function needs documentation.
        /*jslint browser: true */
        window.QM.submit({
            box: 'sean',
            f: function (x) {
             // This function needs documentation.
                return x + 2;
            },
            x: 1
        }).Q(function (evt) {
         // This function needs documentation.
            console.log('Results:', this.val);
            return evt.exit();
        }).on('error', function (message) {
         // This function needs documentation.
            console.error('Error:', message);
            return;
        });
        return;
    });

    run_test('Results: 4', function () {
     // This function needs documentation.
        /*jslint browser: true */
        window.QM.submit(2, function (x) {
         // This function needs documentation.
            return x + 2;
        }, 'sean').Q(function (evt) {
         // This function needs documentation.
            console.log('Results:', this.val);
            return evt.exit();
        }).on('error', function (message) {
         // This function needs documentation.
            console.error('Error:', message);
            return;
        });
        return;
    });

    run_test('Results: 5', function () {
     // This function needs documentation.
        /*jslint browser: true */
        window.QM.submit({
            box: 'sean',
            f: '(x) -> x + 2',
            x: 3
        }).Q(function (evt) {
         // This function needs documentation.
            console.log('Results:', this.val);
            return evt.exit();
        }).on('error', function (message) {
         // This function needs documentation.
            console.error('Error:', message);
            return;
        });
        return;
    });

    run_test('Results: 6', function () {
     // This function needs documentation.
        window.QM.submit({
            box: 'sean',
            f: '(x) -> x + 2',
            x: 4
        }).Q(function (evt) {
         // This function needs documentation.
            console.log('Results:', this.val);
            return evt.exit();
        }).on('error', function (message) {
         // This function needs documentation.
            console.error('Error:', message);
            return;
        });
        return;
    });

 // That's all, folks!

    return;

{'fraction_non_alphanumeric': 0.13039637849177432, 'fraction_numerical': 0.008280887711162636, 'mean_word_length': 1.4843664289632474, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5581537', 'n_tokens_mistral': 2432, 'n_tokens_neox': 2327, 'n_words': 670}