summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorTimothy J Fontaine <tjfontaine@gmail.com>2013-05-23 16:23:07 -0700
committerTimothy J Fontaine <tjfontaine@gmail.com>2013-05-23 16:32:04 -0700
commit007e63bb13b5d3af54081972ab88217571828906 (patch)
treeac48de8f2d94c849e88e288fb6145558f546b748 /test
parenta2f93cf77a8121db713bb003e26031bcca446f1f (diff)
downloadandroid-node-v8-007e63bb13b5d3af54081972ab88217571828906.tar.gz
android-node-v8-007e63bb13b5d3af54081972ab88217571828906.tar.bz2
android-node-v8-007e63bb13b5d3af54081972ab88217571828906.zip
buffer: special case empty string writes
Prior to 119354f we specifically handled passing a zero length string to write on a buffer, restore that functionality.
Diffstat (limited to 'test')
-rw-r--r--test/simple/test-buffer.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/simple/test-buffer.js b/test/simple/test-buffer.js
index 0d071127c9..3026824f0a 100644
--- a/test/simple/test-buffer.js
+++ b/test/simple/test-buffer.js
@@ -998,3 +998,10 @@ assert.equal(Buffer.byteLength('aaaa==', 'base64'), 3);
assert.throws(function() {
Buffer('', 'buffer');
}, TypeError);
+
+assert.doesNotThrow(function () {
+ var slow = new SlowBuffer(1);
+ assert(slow.write('', Buffer.poolSize * 10) === 0);
+ var fast = new Buffer(1);
+ assert(fast.write('', Buffer.poolSize * 10) === 0);
+});