mirror of
https://github.com/nodejs/node.git
synced 2026-11-21 12:59:16 -05:00
stream: Writable should ignore encoding for buffers
Fix #4727 Fix einaros/ws#159
This commit is contained in:
1 parent
6bcd9a4c94
commit
33b2aebb6d
2 files changed
+13
-2
No files matched your search
@@ -280,3 +280,14 @@ test('end callback after .write() call', function (t) {
|
||||
t.end();
|
||||
});
|
||||
});
|
||||
|
||||
test('encoding should be ignored for buffers', function(t) {
|
||||
var tw = new W();
|
||||
var hex = '018b5e9a8f6236ffe30e31baf80d2cf6eb';
|
||||
tw._write = function(chunk, cb) {
|
||||
t.equal(chunk.toString('hex'), hex);
|
||||
t.end();
|
||||
};
|
||||
var buf = new Buffer(hex, 'hex');
|
||||
tw.write(buf, 'binary');
|
||||
});
|
||||
Reference in new issue
Block a user