X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=test%2Funit%2Fcore.js;h=7942548692b0bce7ce9f94426a54aa01238b5288;hb=96152559e0e2fa1afc70f8994e664f5805aebad5;hp=9a1cecbe4225d644a6031b6958ea1e6d49d352c1;hpb=d20e7fede1ea2e7047a34a1749bc127c22b02049;p=jquery.git diff --git a/test/unit/core.js b/test/unit/core.js index 9a1cecb..7942548 100644 --- a/test/unit/core.js +++ b/test/unit/core.js @@ -53,7 +53,7 @@ test("jQuery()", function() { }); test("selector state", function() { - expect(26); + expect(28); var test; @@ -80,6 +80,11 @@ test("selector state", function() { test = jQuery("#main", document.body); equals( test.selector, "#main", "#main Selector" ); equals( test.context, document.body, "#main Context" ); + + // Test cloning + test = jQuery(test); + equals( test.selector, "#main", "#main Selector" ); + equals( test.context, document.body, "#main Context" ); test = jQuery(document.body).find("#main"); equals( test.selector, "#main", "#main find Selector" ); @@ -141,7 +146,7 @@ test("browser", function() { }; for (var i in browsers) { var v = i.toLowerCase().match( /.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/ ); // RegEx from Core jQuery.browser.version check - version = v ? v[1] : null; + var version = v ? v[1] : null; equals( version, browsers[i], "Checking UA string" ); } }); @@ -251,23 +256,23 @@ test("isFunction", function() { }); }); -var foo = false; - test("jQuery('html')", function() { - expect(6); + expect(8); reset(); - foo = false; - var s = jQuery("")[0]; + jQuery.foo = false; + var s = jQuery("")[0]; ok( s, "Creating a script" ); - ok( !foo, "Make sure the script wasn't executed prematurely" ); - jQuery("body").append(""); - ok( foo, "Executing a scripts contents in the right context" ); + ok( !jQuery.foo, "Make sure the script wasn't executed prematurely" ); + jQuery("body").append(""); + ok( jQuery.foo, "Executing a scripts contents in the right context" ); reset(); ok( jQuery("")[0], "Creating a link" ); - reset(); + ok( !jQuery("
'); + stop(); jQuery("#main").html(''); @@ -1320,7 +1398,7 @@ test("html(String)", function() { jQuery("#main").html('foo
'); // it was decided that waiting to execute ALL scripts makes sense since nested ones have to wait anyway so this test case is changed, see #1959 - jQuery("#main").html("