Skip to content

Commit c42da5e

Browse files
duvanmonsaTrott
authored andcommitted
test: duplicated buffer in test-stream2-writable.js
PR-URL: #28380 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Adrian Estrada <[email protected]> Reviewed-By: Yongsheng Zhang <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Rich Trott <[email protected]>
1 parent 88db3e4 commit c42da5e

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

test/parallel/test-stream2-writable.js

+5-3
Original file line numberDiff line numberDiff line change
@@ -229,10 +229,12 @@ for (let i = 0; i < chunks.length; i++) {
229229
tw.end(common.mustCall());
230230
}
231231

232+
const helloWorldBuffer = Buffer.from('hello world');
233+
232234
{
233235
// Verify end() callback with chunk
234236
const tw = new TestWriter();
235-
tw.end(Buffer.from('hello world'), common.mustCall());
237+
tw.end(helloWorldBuffer, common.mustCall());
236238
}
237239

238240
{
@@ -244,15 +246,15 @@ for (let i = 0; i < chunks.length; i++) {
244246
{
245247
// Verify end() callback after write() call
246248
const tw = new TestWriter();
247-
tw.write(Buffer.from('hello world'));
249+
tw.write(helloWorldBuffer);
248250
tw.end(common.mustCall());
249251
}
250252

251253
{
252254
// Verify end() callback after write() callback
253255
const tw = new TestWriter();
254256
let writeCalledback = false;
255-
tw.write(Buffer.from('hello world'), function() {
257+
tw.write(helloWorldBuffer, function() {
256258
writeCalledback = true;
257259
});
258260
tw.end(common.mustCall(function() {

0 commit comments

Comments
 (0)