aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobert Katic <robert.katic@gmail.com>2010-02-04 22:54:53 +0100
committerjeresig <jeresig@gmail.com>2010-09-23 12:07:22 -0400
commit97b42492bb391bab346d265b70dc62e9d90ecd3d (patch)
tree161bdb5cd66cbb576448650d41048986dada2763
parent694b625c92c764621532dba20cbf943302b52d5a (diff)
downloadjquery-97b42492bb391bab346d265b70dc62e9d90ecd3d.tar.gz
jquery-97b42492bb391bab346d265b70dc62e9d90ecd3d.zip
Added some tests for #5991.
-rw-r--r--test/unit/core.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/test/unit/core.js b/test/unit/core.js
index 81bca1072..d83f667dc 100644
--- a/test/unit/core.js
+++ b/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 } };