<commit_before>/*jslint evil: true, browser: true, immed: true, passfail: true, undef: true, newcap: true*/
/*global easyTest, easyXDM, window, checkAcl, getDomainName, getLocation, appendQueryParameters*/
var REMOTE = (function(){
    var remote = location.href;
    switch (location.host) {
        case "provider.easyxdm.net":
            location.href = remote.replace("provider", "consumer");
            break;
        case "easyxdm.net":
            remote = remote.replace("easyxdm.net", "consumer.easyxdm.net");
            break;
        case "consumer.easyxdm.net":
            remote = remote.replace("consumer", "provider");
            break;
        case "xdm1":
            remote = remote.replace("xdm1", "xdm2");
            break;
    }
    return remote.substring(0, remote.lastIndexOf("/"));
}());

function runTests(){

    var i = 0;
    easyTest.test([/**Tests for the presence of namespaces and classes*/{
        name: "Check that the library is complete",
        steps: [{
            name: "check for the presence of easyXDM",
            run: function(){
                if (this.Assert.isObject(easyXDM) && this.Assert.isString(easyXDM.version)) {
                    this.log("found easyXDM, version=" + easyXDM.version);
                    return true;
                }
                return false;
            }
        }, {
            name: "check for the presence of easyXDM.DomHelper",
            run: function(){
                return this.Assert.isObject(easyXDM.DomHelper);
            }
        }, {
            name: "check for the presence of easyXDM.Socket",
            run: function(){
                return this.Assert.isFunction(easyXDM.Socket);
            }
        }, {
            name: "check for the presence of easyXDM.Rpc",
            run: function(){
                return this.Assert.isFunction(easyXDM.Rpc);
            }
        }, {
            name: "check for the presence of easyXDM.stack",
            run: function(){
                return this.Assert.isObject(easyXDM.stack);
            }
        }, {
            name: "check for the presence of easyXDM.stack.PostMessageTransport",
            run: function(){
                return this.Assert.isFunction(easyXDM.stack.PostMessageTransport);
            }
        }, {
            name: "check for the presence of easyXDM.stack.NixTransport",
            run: function(){
                return this.Assert.isFunction(easyXDM.stack.NixTransport);
            }
        }, {
            name: "check for the presence of easyXDM.stack.NameTransport",
            run: function(){
                return this.Assert.isFunction(easyXDM.stack.NameTransport);
            }
        }, {
            name: "check for the presence of easyXDM.stack.HashTransport",
            run: function(){
                return this.Assert.isFunction(easyXDM.stack.HashTransport);
            }
        }, {
            name: "check for the presence of easyXDM.stack.ReliableBehavior",
            run: function(){
                return this.Assert.isFunction(easyXDM.stack.ReliableBehavior);
            }
        }, {
            name: "check for the presence of easyXDM.stack.QueueBehavior",
            run: function(){
                return this.Assert.isFunction(easyXDM.stack.QueueBehavior);
            }
        }, {
            name: "check for the presence of easyXDM.stack.VerifyBehavior",
            run: function(){
                return this.Assert.isFunction(easyXDM.stack.VerifyBehavior);
            }
        }, {
            name: "check for the presence of easyXDM.stack.RpcBehavior",
            run: function(){
                return this.Assert.isFunction(easyXDM.stack.RpcBehavior);
            }
        }]
    }, {
        name: "Check helper functions",
        setUp: function(){
            this.url1 = "http://foo.bar/a/b/c?d=e#f";
            this.url2 = "http://foo.bar:80/a/b/c?d=e#f";
            
        },
        steps: [{
            name: "getDomainName",
            run: function(){
                return getDomainName(this.url1) === "foo.bar";
            }
        }, {
            name: "getLocation",
            run: function(){
                return getLocation(this.url1) === "http://foo.bar";
            }
        }, {
            name: "getLocation with :port",
            run: function(){
                return getLocation(this.url2) === "http://foo.bar:80";
            }
        }, {
            name: "appendQueryParameters",
            run: function(){
                return appendQueryParameters(this.url2, {
                    g: "h"
                }) ===
                "http://foo.bar:80/a/b/c?d=e&g=h#f";
            }
        }]
    }, {
        name: "Check the ACL feature",
        setUp: function(){
            this.acl = ["http://www.domain.invalid", "*.domaina.com", "http://dom?inb.com", "^http://domc{3}ain\\.com$"];
        },
        steps: [{
            name: "Match complete string",
            run: function(){
                return checkAcl(this.acl, "http://www.domain.invalid");
            }
        }, {<commit_msg>Added some filters to some of the tests that can only be run in dev mode<commit_after>/*jslint evil: true, browser: true, immed: true, passfail: true, undef: true, newcap: true*/
/*global easyTest, easyXDM, window, checkAcl, getDomainName, getLocation, appendQueryParameters*/
var REMOTE = (function(){
    var remote = location.href;
    switch (location.host) {
        case "provider.easyxdm.net":
            location.href = remote.replace("provider", "consumer");
            break;
        case "easyxdm.net":
            remote = remote.replace("easyxdm.net", "consumer.easyxdm.net");
            break;
        case "consumer.easyxdm.net":
            remote = remote.replace("consumer", "provider");
            break;
        case "xdm1":
            remote = remote.replace("xdm1", "xdm2");
            break;
    }
    return remote.substring(0, remote.lastIndexOf("/"));
}());

function runTests(){

    var i = 0;
    easyTest.test([/**Tests for the presence of namespaces and classes*/{
        name: "Check that the library is complete",
        steps: [{
            name: "check for the presence of easyXDM",
            run: function(){
                if (this.Assert.isObject(easyXDM) && this.Assert.isString(easyXDM.version)) {
                    this.log("found easyXDM, version=" + easyXDM.version);
                    return true;
                }
                return false;
            }
        }, {
            name: "check for the presence of easyXDM.DomHelper",
            run: function(){
                return this.Assert.isObject(easyXDM.DomHelper);
            }
        }, {
            name: "check for the presence of easyXDM.Socket",
            run: function(){
                return this.Assert.isFunction(easyXDM.Socket);
            }
        }, {
            name: "check for the presence of easyXDM.Rpc",
            run: function(){
                return this.Assert.isFunction(easyXDM.Rpc);
            }
        }, {
            name: "check for the presence of easyXDM.stack",
            run: function(){
                return this.Assert.isObject(easyXDM.stack);
            }
        }, {
            name: "check for the presence of easyXDM.stack.PostMessageTransport",
            run: function(){
                return this.Assert.isFunction(easyXDM.stack.PostMessageTransport);
            }
        }, {
            name: "check for the presence of easyXDM.stack.NixTransport",
            run: function(){
                return this.Assert.isFunction(easyXDM.stack.NixTransport);
            }
        }, {
            name: "check for the presence of easyXDM.stack.NameTransport",
            run: function(){
                return this.Assert.isFunction(easyXDM.stack.NameTransport);
            }
        }, {
            name: "check for the presence of easyXDM.stack.HashTransport",
            run: function(){
                return this.Assert.isFunction(easyXDM.stack.HashTransport);
            }
        }, {
            name: "check for the presence of easyXDM.stack.ReliableBehavior",
            run: function(){
                return this.Assert.isFunction(easyXDM.stack.ReliableBehavior);
            }
        }, {
            name: "check for the presence of easyXDM.stack.QueueBehavior",
            run: function(){
                return this.Assert.isFunction(easyXDM.stack.QueueBehavior);
            }
        }, {
            name: "check for the presence of easyXDM.stack.VerifyBehavior",
            run: function(){
                return this.Assert.isFunction(easyXDM.stack.VerifyBehavior);
            }
        }, {
            name: "check for the presence of easyXDM.stack.RpcBehavior",
            run: function(){
                return this.Assert.isFunction(easyXDM.stack.RpcBehavior);
            }
        }]
    }, {
        name: "Check helper functions",
        runIf: function(){
            if (location.href.indexOf("/src/") != -1) {
                return "This can only be run in development.";
            }
        },
        setUp: function(){
            this.url1 = "http://foo.bar/a/b/c?d=e#f";
            this.url2 = "http://foo.bar:80/a/b/c?d=e#f";
            
        },
        steps: [{
            name: "getDomainName",
            run: function(){
                return getDomainName(this.url1) === "foo.bar";
            }
        }, {
            name: "getLocation",
            run: function(){
                return getLocation(this.url1) === "http://foo.bar";
            }
        }, {
            name: "getLocation with :port",
            run: function(){
                return getLocation(this.url2) === "http://foo.bar:80";
            }
        }, {
            name: "appendQueryParameters",
            run: function(){
                return appendQueryParameters(this.url2, {
                    g: "h"
                }) ===
                "http://foo.bar:80/a/b/c?d=e&g=h#f";
            }
        }]
    }, {
        name: "Check the ACL feature",
        runIf: function(){
            if (location.href.indexOf("/src/") != -1) {
                return "This can only be run in development.";
            }
        },
        setUp: function(){
            this.acl = ["http://www.domain.invalid", "*.domaina.com", "http://dom?inb.com", "^http://domc{3}ain\\.com$"];
        },
        steps: [{
            name: "Match complete string",
            run: function(){
                return checkAcl(this.acl, "http://www.domain.invalid");
            }
        }, {
{'fraction_non_alphanumeric': 0.12932895354293758, 'fraction_numerical': 0.0035664007508212107, 'mean_word_length': 1.5299145299145298, 'pattern_counts': {'":': 8, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, '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': '5130574', 'n_tokens_mistral': 2976, 'n_tokens_neox': 2857, 'n_words': 629}