Skip to content

Commit 6413181

Browse files
committed
Update tests, remove obsolete Buffer.write(...)
1 parent 2c53436 commit 6413181

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

lib/buffer.js

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
'use strict';
33

44
const binding = process.binding('buffer');
5-
const internalUtil = require('internal/util');
65
const bindingObj = {};
76

87
exports.Buffer = Buffer;

test/parallel/test-buffer.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -344,10 +344,10 @@ assert.equal(rangeBuffer.toString({toString: function() {
344344
// testing for smart defaults and ability to pass string values as offset
345345
var writeTest = new Buffer('abcdes');
346346
writeTest.write('n', 'ascii');
347-
writeTest.write('o', 'ascii', '1');
347+
writeTest.write('o', '1', 'ascii');
348348
writeTest.write('d', '2', 'ascii');
349349
writeTest.write('e', 3, 'ascii');
350-
writeTest.write('j', 'ascii', 4);
350+
writeTest.write('j', 4, 'ascii');
351351
assert.equal(writeTest.toString(), 'nodejs');
352352

353353
// ASCII slice test
@@ -888,7 +888,7 @@ assert.equal(0, Buffer('hello').slice(0, 0).length);
888888
assert.equal(buf[3], 0x63);
889889

890890
buf.fill(0xFF);
891-
written = buf.write('abcd', 'utf8', 1, 2); // legacy style
891+
written = buf.write('abcd', 1, 2, 'utf8');
892892
console.log(buf);
893893
assert.equal(written, 2);
894894
assert.equal(buf[0], 0xFF);

0 commit comments

Comments
 (0)