Skip to content

Commit

Permalink
turn examples into tests, everything passes
Browse files Browse the repository at this point in the history
  • Loading branch information
James Halliday committed Jul 16, 2013
1 parent 3e5363a commit cccbd24
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/nested.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
var test = require('tape');
var stringify = require('../');

test('nested', function (t) {
t.plan(1);
var obj = { c: 8, b: [{z:6,y:5,x:4},7], a: 3 };
t.equal(stringify(obj), '{"a":3,"b":[{"x":4,"y":5,"z":6},7],"c":8}');
});
8 changes: 8 additions & 0 deletions test/str.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
var test = require('tape');
var stringify = require('../');

test('simple object', function (t) {
t.plan(1);
var obj = { c: 6, b: [4,5], a: 3 };
t.equal(stringify(obj), '{"a":3,"b":[4,5],"c":6}');
});

0 comments on commit cccbd24

Please sign in to comment.