Added some tests for #5991.
This commit is contained in:
parent
694b625c92
commit
97b42492bb
1 changed files with 5 additions and 1 deletions
|
@ -661,7 +661,7 @@ test("jQuery.merge()", function() {
|
||||||
});
|
});
|
||||||
|
|
||||||
test("jQuery.extend(Object, Object)", function() {
|
test("jQuery.extend(Object, Object)", function() {
|
||||||
expect(26);
|
expect(28);
|
||||||
|
|
||||||
var settings = { xnumber1: 5, xnumber2: 7, xstring1: "peter", xstring2: "pan" },
|
var settings = { xnumber1: 5, xnumber2: 7, xstring1: "peter", xstring2: "pan" },
|
||||||
options = { xnumber2: 1, xstring2: "x", xxx: "newstring" },
|
options = { xnumber2: 1, xstring2: "x", xxx: "newstring" },
|
||||||
|
@ -690,6 +690,10 @@ test("jQuery.extend(Object, Object)", function() {
|
||||||
|
|
||||||
ok( jQuery.extend(true, {}, nestedarray).arr !== arr, "Deep extend of object must clone child array" );
|
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 empty = {};
|
||||||
var optionsWithLength = { foo: { length: -1 } };
|
var optionsWithLength = { foo: { length: -1 } };
|
||||||
jQuery.extend(true, empty, optionsWithLength);
|
jQuery.extend(true, empty, optionsWithLength);
|
||||||
|
|
Loading…
Add table
Reference in a new issue