Skip to content

Commit

Permalink
add breaking test (acyclic detected as cyclic)
Browse files Browse the repository at this point in the history
  • Loading branch information
mvayngrib committed Oct 13, 2015
1 parent f70d444 commit 7f5f443
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions test/nested.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,10 @@ test('cyclic (specifically allowed)', function (t) {
one.two = two;
t.equal(stringify(one, {cycles:true}), '{"a":1,"two":{"a":2,"one":"__cycle__"}}');
});

test('acyclic but with reused obj-property pointers', function (t) {
t.plan(1);
var x = { a: 1 }
var y = { b: x, c: x }
t.equal(stringify(y), '{"b":{"a":1},"c":{"a":1}}');
});

0 comments on commit 7f5f443

Please sign in to comment.