|
1 | 1 | test( "$.widget.extend()", function() { |
2 | | - expect( 26 ); |
| 2 | + expect( 27 ); |
3 | 3 |
|
4 | 4 | var ret, empty, optionsWithLength, optionsWithDate, myKlass, customObject, optionsWithCustomObject, nullUndef, |
5 | 5 | target, recursive, obj, input, output, |
@@ -76,13 +76,16 @@ test( "$.widget.extend()", function() { |
76 | 76 | ret = $.widget.extend( { foo: [] }, { foo: [0] } ); // 1907 |
77 | 77 | equal( ret.foo.length, 1, "Check to make sure a value with coersion 'false' copies over when necessary to fix #1907" ); |
78 | 78 |
|
79 | | - ret = $.widget.extend( { foo: "1,2,3" }, { foo: [1, 2, 3] } ); |
80 | | - strictEqual( typeof ret.foo, "object", "Check to make sure values equal with coersion (but not actually equal) overwrite correctly" ); |
| 79 | + ret = $.widget.extend( { foo: "1,2,3" }, { foo: [ 1, 2, 3 ] } ); |
| 80 | + deepEqual( ret.foo, [ 1, 2, 3 ], "Properly extend a string to array." ); |
| 81 | + |
| 82 | + ret = $.widget.extend( { foo: "1,2,3" }, { foo: { to: "object" } } ); |
| 83 | + deepEqual( ret.foo, { to: "object" }, "Properly extend a string to object." ); |
81 | 84 |
|
82 | 85 | ret = $.widget.extend( { foo: "bar" }, { foo: null } ); |
83 | | - strictEqual( typeof ret.foo, "object", "Make sure a null value doesn't crash with deep extend, for #1908" ); |
| 86 | + strictEqual( ret.foo, null, "Make sure a null value doesn't crash with deep extend, for #1908" ); |
84 | 87 |
|
85 | | - obj = { foo:null }; |
| 88 | + obj = { foo: null }; |
86 | 89 | $.widget.extend( obj, { foo:"notnull" } ); |
87 | 90 | equal( obj.foo, "notnull", "Make sure a null value can be overwritten" ); |
88 | 91 |
|
|
0 commit comments