From eb077c45243e6c3f74c828b24f857fba40cd7846 Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Wed, 16 Jul 2014 22:56:44 -0700 Subject: [PATCH] add failing test for new buffer from buffer.toJSON() for #37 --- test/basic.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/basic.js b/test/basic.js index a369c62..a24986b 100644 --- a/test/basic.js +++ b/test/basic.js @@ -161,6 +161,15 @@ test('buffer toJSON()', function (t) { t.end() }) +test('new buffer from buffer.toJSON() output', function (t) { + var buf = new B('test') + var json = JSON.stringify(buf) + var obj = JSON.parse(json) + var copy = new B(obj) + t.ok(buf.equals(copy)) + t.end() +}) + test('buffer copy example', function (t) { var buf1 = new B(26) var buf2 = new B(26) -- 2.34.1