From 8078ed1f865a2f8ed5d34e156ff0ac4e43ca8f20 Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Tue, 7 Sep 2010 21:40:15 -0700 Subject: [PATCH] Expose fast-buffer bug in tests --- test/simple/test-buffer.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/test/simple/test-buffer.js b/test/simple/test-buffer.js index 80fd1b08cf4..abe4e15e972 100644 --- a/test/simple/test-buffer.js +++ b/test/simple/test-buffer.js @@ -294,3 +294,19 @@ assert.equal(dot[1], 0xfe); assert.equal(dot[2], 0x2e); assert.equal(dot[3], 0x00); assert.equal(dot.toString('base64'), '//4uAA=='); + + +// Creating buffers larger than pool size. +s = "" +for (i = 0; i < Buffer.poolSize + 5; i++) { + s += "h"; +} +b = Buffer(s); +sb = b.toString(); +assert.equal(sb, s); + + + + + +