main
Last change
on this file was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago |
Update repo after prototype presentation
|
-
Property mode
set to
100644
|
File size:
451 bytes
|
Rev | Line | |
---|
[d565449] | 1 | var inspect = require('../');
|
---|
| 2 | var test = require('tape');
|
---|
| 3 |
|
---|
| 4 | test('circular', function (t) {
|
---|
| 5 | t.plan(2);
|
---|
| 6 | var obj = { a: 1, b: [3, 4] };
|
---|
| 7 | obj.c = obj;
|
---|
| 8 | t.equal(inspect(obj), '{ a: 1, b: [ 3, 4 ], c: [Circular] }');
|
---|
| 9 |
|
---|
| 10 | var double = {};
|
---|
| 11 | double.a = [double];
|
---|
| 12 | double.b = {};
|
---|
| 13 | double.b.inner = double.b;
|
---|
| 14 | double.b.obj = double;
|
---|
| 15 | t.equal(inspect(double), '{ a: [ [Circular] ], b: { inner: [Circular], obj: [Circular] } }');
|
---|
| 16 | });
|
---|
Note:
See
TracBrowser
for help on using the repository browser.