X-Git-Url: http://git.asbjorn.it/?a=blobdiff_plain;f=test%2Funit%2Fcore.js;h=7ef2ad7e2a8ad2cdd560fd82d87aa508b80bb6bf;hb=515efbdc7119aa79de710144effe18413d4cb14a;hp=81bca1072d8b64258bdfe26c82211848c79b32b2;hpb=694b625c92c764621532dba20cbf943302b52d5a;p=jquery.git diff --git a/test/unit/core.js b/test/unit/core.js index 81bca10..7ef2ad7 100644 --- a/test/unit/core.js +++ b/test/unit/core.js @@ -219,7 +219,7 @@ test("trim", function() { }); test("type", function() { - expect(18); + expect(23); equals( jQuery.type(null), "null", "null" ); equals( jQuery.type(undefined), "undefined", "undefined" ); @@ -239,6 +239,11 @@ test("type", function() { equals( jQuery.type(new Date()), "date", "Date" ); equals( jQuery.type(new Function("return;")), "function", "Function" ); equals( jQuery.type(function(){}), "function", "Function" ); + equals( jQuery.type(window), "object", "Window" ); + equals( jQuery.type(document), "object", "Document" ); + equals( jQuery.type(document.body), "object", "Element" ); + equals( jQuery.type(document.createTextNode("foo")), "object", "TextNode" ); + equals( jQuery.type(document.getElementsByTagName("*")), "object", "NodeList" ); }); test("isPlainObject", function() { @@ -661,7 +666,7 @@ test("jQuery.merge()", function() { }); test("jQuery.extend(Object, Object)", function() { - expect(26); + expect(28); var settings = { xnumber1: 5, xnumber2: 7, xstring1: "peter", xstring2: "pan" }, options = { xnumber2: 1, xstring2: "x", xxx: "newstring" }, @@ -689,6 +694,10 @@ test("jQuery.extend(Object, Object)", function() { equals( deep1.foo2, document, "Make sure that a deep clone was not attempted on the document" ); ok( jQuery.extend(true, {}, nestedarray).arr !== arr, "Deep extend of object must clone child array" ); + + // #5991 + ok( jQuery.isArray( jQuery.extend(true, { arr: {} }, nestedarray).arr ), "Cloned array heve to be an Array" ); + ok( jQuery.isPlainObject( jQuery.extend(true, { arr: arr }, { arr: {} }).arr ), "Cloned object heve to be an plain object" ); var empty = {}; var optionsWithLength = { foo: { length: -1 } };