X-Git-Url: http://git.asbjorn.it/?a=blobdiff_plain;f=test%2Funit%2Fcore.js;h=a1ebb1ba428d111a38e93a5e7576c98f7d4c00ea;hb=aee221d33c2db2c76639dabeca2b1e3d022e348e;hp=ce70be6887efd92379be6e5cc927a8367c3ce7b8;hpb=b6d70a7ce3795e8c1306a513b89a31de0c5f0a13;p=jquery.git diff --git a/test/unit/core.js b/test/unit/core.js index ce70be6..a1ebb1b 100644 --- a/test/unit/core.js +++ b/test/unit/core.js @@ -837,7 +837,7 @@ test("is(String)", function() { }); test("$.extend(Object, Object)", function() { - expect(15); + expect(17); var settings = { xnumber1: 5, xnumber2: 7, xstring1: "peter", xstring2: "pan" }, options = { xnumber2: 1, xstring2: "x", xxx: "newstring" }, @@ -876,6 +876,14 @@ test("$.extend(Object, Object)", function() { var ret = jQuery.extend(true, { foo:"bar" }, { foo:null } ); ok( typeof ret.foo !== 'undefined', "Make sure a null value doesn't crash with deep extend, for #1908" ); + var obj = { foo:null }; + jQuery.extend(true, obj, { foo:"notnull" } ); + equals( obj.foo, "notnull", "Make sure a null value can be overwritten" ); + + function func() {} + jQuery.extend(func, { key: "value" } ); + equals( func.key, "value", "Verify a function can be extended" ); + var defaults = { xnumber1: 5, xnumber2: 7, xstring1: "peter", xstring2: "pan" }, defaultsCopy = { xnumber1: 5, xnumber2: 7, xstring1: "peter", xstring2: "pan" }, options1 = { xnumber2: 1, xstring2: "x" },