Skip to content

Commit 613315e

Browse files
committed
fix tests
1 parent 1626ce2 commit 613315e

File tree

6 files changed

+21
-4
lines changed

6 files changed

+21
-4
lines changed

build/test-replacements.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@ module.exports['test-stream2-transform.js'] = [
6060
module.exports['test-stream2-writable.js'] = [
6161
altForEachImplReplacement
6262
, altForEachUseReplacement
63+
, [
64+
/'latin1',/g,
65+
'\'binary\','
66+
]
6367
]
6468

6569
module.exports['test-stream-big-packet.js'] = [
@@ -274,3 +278,9 @@ module.exports['test-stream2-readable-from-list.js'] = [
274278
'require(\'../../lib/internal/streams/BufferList\')'
275279
]
276280
]
281+
module.exports['test-stream-writev.js'] = [
282+
[
283+
/'latin1'/g,
284+
`'binary'`
285+
]
286+
]

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"devDependencies": {
1616
"assert": "~1.4.0",
1717
"babel-polyfill": "^6.9.1",
18+
"buffer": "^4.9.0",
1819
"nyc": "^6.4.0",
1920
"tap": "~0.7.1",
2021
"tape": "~4.5.1",
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
abc
2+
def
3+
ghi
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
abc
2+
def
3+
ghi

test/parallel/test-stream-writev.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ function test(decode, uncork, multi, next) {
4646
chunk: [119, 111, 114, 108, 100] }, { encoding: 'buffer',
4747
chunk: [33] }, { encoding: 'buffer',
4848
chunk: [10, 97, 110, 100, 32, 116, 104, 101, 110, 46, 46, 46] }, { encoding: 'buffer',
49-
chunk: [250, 206, 190, 167, 222, 173, 190, 239, 222, 202, 251, 173] }] : [{ encoding: 'ascii', chunk: 'hello, ' }, { encoding: 'utf8', chunk: 'world' }, { encoding: 'buffer', chunk: [33] }, { encoding: 'latin1', chunk: '\nand then...' }, { encoding: 'hex', chunk: 'facebea7deadbeefdecafbad' }];
49+
chunk: [250, 206, 190, 167, 222, 173, 190, 239, 222, 202, 251, 173] }] : [{ encoding: 'ascii', chunk: 'hello, ' }, { encoding: 'utf8', chunk: 'world' }, { encoding: 'buffer', chunk: [33] }, { encoding: 'binary', chunk: '\nand then...' }, { encoding: 'hex', chunk: 'facebea7deadbeefdecafbad' }];
5050

5151
var actualChunks;
5252
w._writev = function (chunks, cb) {
@@ -66,7 +66,7 @@ function test(decode, uncork, multi, next) {
6666
if (multi) w.cork();
6767

6868
w.write(bufferShim.from('!'), 'buffer', cnt('!'));
69-
w.write('\nand then...', 'latin1', cnt('and then'));
69+
w.write('\nand then...', 'binary', cnt('and then'));
7070

7171
if (multi) w.uncork();
7272

test/parallel/test-stream2-writable.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ test('write bufferize', function (t) {
133133
highWaterMark: 100
134134
});
135135

136-
var encodings = ['hex', 'utf8', 'utf-8', 'ascii', 'latin1', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', undefined];
136+
var encodings = ['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', undefined];
137137

138138
tw.on('finish', function () {
139139
t.same(tw.buffer, chunks, 'got the expected chunks');
@@ -159,7 +159,7 @@ test('write no bufferize', function (t) {
159159
return TestWriter.prototype._write.call(this, chunk, encoding, cb);
160160
};
161161

162-
var encodings = ['hex', 'utf8', 'utf-8', 'ascii', 'latin1', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', undefined];
162+
var encodings = ['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', undefined];
163163

164164
tw.on('finish', function () {
165165
t.same(tw.buffer, chunks, 'got the expected chunks');

0 commit comments

Comments
 (0)