Skip to content
Permalink
Browse files

Added some tests for #5991.

  • Loading branch information
rkatic authored and jeresig committed Feb 4, 2010
1 parent 694b625 commit 97b42492bb391bab346d265b70dc62e9d90ecd3d
Showing with 5 additions and 1 deletion.
  1. +5 −1 test/unit/core.js
@@ -661,7 +661,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 +689,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 } };

0 comments on commit 97b4249

Please sign in to comment.
You can’t perform that action at this time.