Skip to content

Commit

Permalink
a passing test for the other case of structural deep circular referen…
Browse files Browse the repository at this point in the history
…ce checking
  • Loading branch information
James Halliday committed Jun 3, 2011
1 parent cb7c1b0 commit 04e5492
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions test/equal.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,22 @@ exports.deepDates = function () {

exports.deepCircular = function () {
var a = [1];
a.push(a); // a = [ 1, a ]
a.push(a); // a = [ 1, *a ]

var b = [1];
b.push(a); // b = [ 1, [ 1, a ] ]
b.push(a); // b = [ 1, [ 1, *a ] ]

assert.ok(
!traverse.deepEqual(a, b),
'circular ref mount points count towards equality'
);

var c = [1];
c.push(c); // c = [ 1, *c ]
assert.ok(
traverse.deepEqual(a, c),
'circular refs are structurally the same here'
);
};

exports.deepInstances = function () {
Expand Down

0 comments on commit 04e5492

Please sign in to comment.