Skip to content

Commit 7a35077

Browse files
tonyhtytargos
authored andcommitted
test: add mustCall to test-fs-readfile-pipe
PR-URL: #27450 Reviewed-By: Yorkie Liu <yorkiefixer@gmail.com> Reviewed-By: Weijia Wang <starkwang@126.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
1 parent af29ae0 commit 7a35077

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

‎test/parallel/test-fs-readfile-pipe.js‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ const assert = require('assert');
3131
constfs=require('fs');
3232

3333
if(process.argv[2]==='child'){
34-
fs.readFile('/dev/stdin',function(er,data){
34+
fs.readFile('/dev/stdin',common.mustCall(function(er,data){
3535
assert.ifError(er);
3636
process.stdout.write(data);
37-
});
37+
}));
3838
return;
3939
}
4040

@@ -47,7 +47,7 @@ const exec = require('child_process').exec;
4747
constf=JSON.stringify(__filename);
4848
constnode=JSON.stringify(process.execPath);
4949
constcmd=`cat ${filename} | ${node}${f} child`;
50-
exec(cmd,function(err,stdout,stderr){
50+
exec(cmd,common.mustCall(function(err,stdout,stderr){
5151
assert.ifError(err);
5252
assert.strictEqual(
5353
stdout,
@@ -58,4 +58,4 @@ exec(cmd, function(err, stdout, stderr) {
5858
'',
5959
`expected not to read anything from stderr but got: '${stderr}'`);
6060
console.log('ok');
61-
});
61+
}));

0 commit comments

Comments
 (0)