var test=require("tape"),extend=require("./"),mutableExtend=require("./mutable");test("merge",function(e){e.deepEqual(extend({a:"foo"},{b:"bar"}),{a:"foo",b:"bar"}),e.end()}),test("replace",function(e){e.deepEqual(extend({a:"foo"},{a:"bar"}),{a:"bar"}),e.end()}),test("undefined",function(e){var a={a:void 0},t={b:"foo"};e.deepEqual(extend(a,t),{a:void 0,b:"foo"}),e.deepEqual(extend(t,a),{a:void 0,b:"foo"}),e.end()}),test("handle 0",function(e){var a={a:"default"},t={a:0};e.deepEqual(extend(a,t),{a:0}),e.deepEqual(extend(t,a),{a:"default"}),e.end()}),test("is immutable",function(e){var a={};extend(a,{foo:"bar"}),e.equal(a.foo,void 0),e.end()}),test("null as argument",function(e){e.deepEqual(extend(null,{foo:"bar"},void 0),{foo:"bar"}),e.end()}),test("mutable",function(e){var a={foo:"bar"};mutableExtend(a,{bar:"baz"}),e.equal(a.bar,"baz"),e.end()}),test("null prototype",function(e){var a=Object.create(null);a.b="bar",e.deepEqual(extend({a:"foo"},a),{a:"foo",b:"bar"}),e.end()}),test("null prototype mutable",function(e){var a={foo:"bar"},t=Object.create(null);t.bar="baz",mutableExtend(a,t),e.equal(a.bar,"baz"),e.end()});