<commit_before>
module("core");

test( "jQuery(html) loose rules", function() {
	expect( 12 );

	var nowarns = {
			"simple tag": "<div />",
			"single tag with properties": "<input type=text name=easy />",
			"complex html": "<div id='good'><p id='guy'> hello !</p></div>"
		},
		warns = {
			"leading space": "  <div />",
			"leading text": "don't<div>try this</div>",
			"leading hash": "#yeah<p>RIGHT</p>"
		},
		makeFn = function( html ) {
			return function() {
				// Bad HTML will throw but not on all versions
				try {
					jQuery( html );
					ok( true, html + " succeeded" );
				} catch ( e ) {
					ok( true, html + " got exception" );
				}
			};
		},
		w;

	for ( w in nowarns ) {
		expectNoWarning( w, makeFn( nowarns[ w ] ) );
	}
	for ( w in warns ) {
		expectWarning( w, makeFn( warns[ w ] ) );
	}
});

test( "jQuery.browser", function() {
	expect( 3 );

	( jQuery._definePropertyBroken ? expectNoWarning : expectWarning )( "browser", function() {
		ok( jQuery.browser, "jQuery.browser present" );
		ok( jQuery.browser.version, "have a browser version" );
	});
});

test( "jQuery.sub() - Static Methods", function(){
	expect( 19 );

	var Subclass;

	// Other warnings may be fired when props are copied
	expectWarning( "jQuery.sub", function() {
		Subclass = jQuery.sub();
	});

	Subclass.extend({
		"topLevelMethod": function() {return this.debug;},
		"debug": false,
		"config": {
			"locale": "en_US"
		},
		"setup": function(config) {
			this.extend(true, this["config"], config);
		}
	});
	Subclass.fn.extend({"subClassMethod": function() { return this;}});

	//Test Simple Subclass
	ok(Subclass["topLevelMethod"]() === false, "Subclass.topLevelMethod thought debug was true");
	ok(Subclass["config"]["locale"] == "en_US", Subclass["config"]["locale"] + " is wrong!");
	deepEqual(Subclass["config"]["test"], undefined, "Subclass.config.test is set incorrectly");
	equal(jQuery.ajax, Subclass.ajax, "The subclass failed to get all top level methods");

	//Create a SubSubclass
	var SubSubclass = Subclass.sub();

	//Make Sure the SubSubclass inherited properly
	ok(SubSubclass["topLevelMethod"]() === false, "SubSubclass.topLevelMethod thought debug was true");
	ok(SubSubclass["config"]["locale"] == "en_US", SubSubclass["config"]["locale"] + " is wrong!");
	deepEqual(SubSubclass["config"]["test"], undefined, "SubSubclass.config.test is set incorrectly");
	equal(jQuery.ajax, SubSubclass.ajax, "The subsubclass failed to get all top level methods");

	//Modify The Subclass and test the Modifications
	SubSubclass.fn.extend({"subSubClassMethod": function() { return this;}});
	SubSubclass["setup"]({"locale": "es_MX", "test": "worked"});
	SubSubclass["debug"] = true;
	SubSubclass.ajax = function() {return false;};
	ok(SubSubclass["topLevelMethod"](), "SubSubclass.topLevelMethod thought debug was false");
	deepEqual(SubSubclass(document)["subClassMethod"], Subclass.fn["subClassMethod"], "Methods Differ!");
	ok(SubSubclass["config"]["locale"] == "es_MX", SubSubclass["config"]["locale"] + " is wrong!");
	ok(SubSubclass["config"]["test"] == "worked", "SubSubclass.config.test is set incorrectly");
	notEqual(jQuery.ajax, SubSubclass.ajax, "The subsubclass failed to get all top level methods");

	//This shows that the modifications to the SubSubClass did not bubble back up to it's superclass
	ok(Subclass["topLevelMethod"]() === false, "Subclass.topLevelMethod thought debug was true");
	ok(Subclass["config"]["locale"] == "en_US", Subclass["config"]["locale"] + " is wrong!");
	deepEqual(Subclass["config"]["test"], undefined, "Subclass.config.test is set incorrectly");
	deepEqual(Subclass(document)["subSubClassMethod"], undefined, "subSubClassMethod set incorrectly");
	equal(jQuery.ajax, Subclass.ajax, "The subclass failed to get all top level methods");
});

test( "jQuery.sub() - .fn Methods", function(){
	expect( 378 );

	var Subclass = jQuery.sub(),
		SubclassSubclass = Subclass.sub(),
		jQueryDocument = jQuery(document),
		selectors, contexts, methods, method, arg, description,
		warnLength = jQuery.compatWarnings.length;

	jQueryDocument.toString = function(){ return "jQueryDocument"; };<commit_msg>Remove a stray variable from test refactor.<commit_after>
module("core");

test( "jQuery(html) loose rules", function() {
	expect( 12 );

	var nowarns = {
			"simple tag": "<div />",
			"single tag with properties": "<input type=text name=easy />",
			"complex html": "<div id='good'><p id='guy'> hello !</p></div>"
		},
		warns = {
			"leading space": "  <div />",
			"leading text": "don't<div>try this</div>",
			"leading hash": "#yeah<p>RIGHT</p>"
		},
		makeFn = function( html ) {
			return function() {
				// Bad HTML will throw but not on all versions
				try {
					jQuery( html );
					ok( true, html + " succeeded" );
				} catch ( e ) {
					ok( true, html + " got exception" );
				}
			};
		},
		w;

	for ( w in nowarns ) {
		expectNoWarning( w, makeFn( nowarns[ w ] ) );
	}
	for ( w in warns ) {
		expectWarning( w, makeFn( warns[ w ] ) );
	}
});

test( "jQuery.browser", function() {
	expect( 3 );

	( jQuery._definePropertyBroken ? expectNoWarning : expectWarning )( "browser", function() {
		ok( jQuery.browser, "jQuery.browser present" );
		ok( jQuery.browser.version, "have a browser version" );
	});
});

test( "jQuery.sub() - Static Methods", function(){
	expect( 19 );

	var Subclass;

	// Other warnings may be fired when props are copied
	expectWarning( "jQuery.sub", function() {
		Subclass = jQuery.sub();
	});

	Subclass.extend({
		"topLevelMethod": function() {return this.debug;},
		"debug": false,
		"config": {
			"locale": "en_US"
		},
		"setup": function(config) {
			this.extend(true, this["config"], config);
		}
	});
	Subclass.fn.extend({"subClassMethod": function() { return this;}});

	//Test Simple Subclass
	ok(Subclass["topLevelMethod"]() === false, "Subclass.topLevelMethod thought debug was true");
	ok(Subclass["config"]["locale"] == "en_US", Subclass["config"]["locale"] + " is wrong!");
	deepEqual(Subclass["config"]["test"], undefined, "Subclass.config.test is set incorrectly");
	equal(jQuery.ajax, Subclass.ajax, "The subclass failed to get all top level methods");

	//Create a SubSubclass
	var SubSubclass = Subclass.sub();

	//Make Sure the SubSubclass inherited properly
	ok(SubSubclass["topLevelMethod"]() === false, "SubSubclass.topLevelMethod thought debug was true");
	ok(SubSubclass["config"]["locale"] == "en_US", SubSubclass["config"]["locale"] + " is wrong!");
	deepEqual(SubSubclass["config"]["test"], undefined, "SubSubclass.config.test is set incorrectly");
	equal(jQuery.ajax, SubSubclass.ajax, "The subsubclass failed to get all top level methods");

	//Modify The Subclass and test the Modifications
	SubSubclass.fn.extend({"subSubClassMethod": function() { return this;}});
	SubSubclass["setup"]({"locale": "es_MX", "test": "worked"});
	SubSubclass["debug"] = true;
	SubSubclass.ajax = function() {return false;};
	ok(SubSubclass["topLevelMethod"](), "SubSubclass.topLevelMethod thought debug was false");
	deepEqual(SubSubclass(document)["subClassMethod"], Subclass.fn["subClassMethod"], "Methods Differ!");
	ok(SubSubclass["config"]["locale"] == "es_MX", SubSubclass["config"]["locale"] + " is wrong!");
	ok(SubSubclass["config"]["test"] == "worked", "SubSubclass.config.test is set incorrectly");
	notEqual(jQuery.ajax, SubSubclass.ajax, "The subsubclass failed to get all top level methods");

	//This shows that the modifications to the SubSubClass did not bubble back up to it's superclass
	ok(Subclass["topLevelMethod"]() === false, "Subclass.topLevelMethod thought debug was true");
	ok(Subclass["config"]["locale"] == "en_US", Subclass["config"]["locale"] + " is wrong!");
	deepEqual(Subclass["config"]["test"], undefined, "Subclass.config.test is set incorrectly");
	deepEqual(Subclass(document)["subSubClassMethod"], undefined, "subSubClassMethod set incorrectly");
	equal(jQuery.ajax, Subclass.ajax, "The subclass failed to get all top level methods");
});

test( "jQuery.sub() - .fn Methods", function(){
	expect( 378 );

	var Subclass = jQuery.sub(),
		SubclassSubclass = Subclass.sub(),
		jQueryDocument = jQuery(document),
		selectors, contexts, methods, method, arg, description;

	jQueryDocument.toString = function(){ return "jQueryDocument"; };
{'fraction_non_alphanumeric': 0.17735120125558373, 'fraction_numerical': 0.0019316672703126887, 'mean_word_length': 5.033503277494537, 'pattern_counts': {'":': 30, '<': 25, '<?xml version=': 0, '>': 25, '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': '3162541', 'n_tokens_mistral': 2770, 'n_tokens_neox': 2612, 'n_words': 704}