Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 16926a8

Browse filesBrowse files
duvanmonsatargos
authored andcommitted
test: duplicated buffer in test-stream2-writable.js
PR-URL: #28380 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Adrian Estrada <edsadr@gmail.com> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
1 parent 91d5a4d commit 16926a8
Copy full SHA for 16926a8

File tree

Expand file treeCollapse file tree

1 file changed

+5
-3
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+5
-3
lines changed
Open diff view settings
Collapse file

‎test/parallel/test-stream2-writable.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-stream2-writable.js
+5-3Lines changed: 5 additions & 3 deletions
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.