Skip to content

Commit

Permalink
now passing all the equality tests again
Browse files Browse the repository at this point in the history
  • Loading branch information
James Halliday committed Jun 6, 2011
1 parent 56553ff commit 6721461
Showing 1 changed file with 36 additions and 2 deletions.
38 changes: 36 additions & 2 deletions test/mutability.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,39 @@ exports.delete = function () {
if (this.isLeaf && x % 2 == 0) this.delete();
});

assert.ok(!Traverse.deepEqual(
obj, { a : 1, c : [ 3, undefined ] }
));

assert.ok(Traverse.deepEqual(
obj,
{ a : 1, c : [ 3, undefined ] }
obj, { a : 1, c : [ 3 ] }
));

assert.ok(!Traverse.deepEqual(
obj, { a : 1, c : [ 3, null ] }
));
};

exports.deleteRedux = function () {
var obj = { a : 1, b : 2, c : [ 3, 4, 5 ] };
Traverse(obj).forEach(function (x) {
if (this.isLeaf && x % 2 == 0) this.delete();
});

assert.ok(!Traverse.deepEqual(
obj, { a : 1, c : [ 3, undefined, 5 ] }
));

assert.ok(Traverse.deepEqual(
obj, { a : 1, c : [ 3 ,, 5 ] }
));

assert.ok(!Traverse.deepEqual(
obj, { a : 1, c : [ 3, null, 5 ] }
));

assert.ok(!Traverse.deepEqual(
obj, { a : 1, c : [ 3, 5 ] }
));
};

Expand Down Expand Up @@ -163,6 +193,10 @@ exports.deleteMapRedux = function () {
res, { a : 1, c : xs }
));

assert.ok(!Traverse.deepEqual(
res, { a : 1, c : [ 3, 5 ] }
));

assert.ok(Traverse.deepEqual(
res, { a : 1, c : [ 3 ,, 5 ] }
));
Expand Down

0 comments on commit 6721461

Please sign in to comment.