Skip to content

Commit a4d1436

Browse files
vsemozhetbytaddaleax
authored andcommitted
test: fix args in parallel/test-fs-null-bytes.js
The functions `fs.appendFile()` and `fs.writeFile()` were being called without the required `data` argument. Refs: #11595 PR-URL: #11601 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Nikolai Vavilov <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Yuta Hiroto <[email protected]>
1 parent 8377374 commit a4d1436

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

test/parallel/test-fs-null-bytes.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ function check(async, sync) {
2323

2424
check(fs.access, fs.accessSync, 'foo\u0000bar');
2525
check(fs.access, fs.accessSync, 'foo\u0000bar', fs.F_OK);
26-
check(fs.appendFile, fs.appendFileSync, 'foo\u0000bar');
26+
check(fs.appendFile, fs.appendFileSync, 'foo\u0000bar', 'abc');
2727
check(fs.chmod, fs.chmodSync, 'foo\u0000bar', '0644');
2828
check(fs.chown, fs.chownSync, 'foo\u0000bar', 12, 34);
2929
check(fs.link, fs.linkSync, 'foo\u0000bar', 'foobar');
@@ -47,14 +47,14 @@ check(null, fs.unwatchFile, 'foo\u0000bar', common.mustNotCall());
4747
check(fs.utimes, fs.utimesSync, 'foo\u0000bar', 0, 0);
4848
check(null, fs.watch, 'foo\u0000bar', common.mustNotCall());
4949
check(null, fs.watchFile, 'foo\u0000bar', common.mustNotCall());
50-
check(fs.writeFile, fs.writeFileSync, 'foo\u0000bar');
50+
check(fs.writeFile, fs.writeFileSync, 'foo\u0000bar', 'abc');
5151

5252
const fileUrl = new URL('file:///C:/foo\u0000bar');
5353
const fileUrl2 = new URL('file:///C:/foo%00bar');
5454

5555
check(fs.access, fs.accessSync, fileUrl);
5656
check(fs.access, fs.accessSync, fileUrl, fs.F_OK);
57-
check(fs.appendFile, fs.appendFileSync, fileUrl);
57+
check(fs.appendFile, fs.appendFileSync, fileUrl, 'abc');
5858
check(fs.chmod, fs.chmodSync, fileUrl, '0644');
5959
check(fs.chown, fs.chownSync, fileUrl, 12, 34);
6060
check(fs.link, fs.linkSync, fileUrl, 'foobar');
@@ -78,11 +78,11 @@ check(null, fs.unwatchFile, fileUrl, common.fail);
7878
check(fs.utimes, fs.utimesSync, fileUrl, 0, 0);
7979
check(null, fs.watch, fileUrl, common.fail);
8080
check(null, fs.watchFile, fileUrl, common.fail);
81-
check(fs.writeFile, fs.writeFileSync, fileUrl);
81+
check(fs.writeFile, fs.writeFileSync, fileUrl, 'abc');
8282

8383
check(fs.access, fs.accessSync, fileUrl2);
8484
check(fs.access, fs.accessSync, fileUrl2, fs.F_OK);
85-
check(fs.appendFile, fs.appendFileSync, fileUrl2);
85+
check(fs.appendFile, fs.appendFileSync, fileUrl2, 'abc');
8686
check(fs.chmod, fs.chmodSync, fileUrl2, '0644');
8787
check(fs.chown, fs.chownSync, fileUrl2, 12, 34);
8888
check(fs.link, fs.linkSync, fileUrl2, 'foobar');
@@ -106,7 +106,7 @@ check(null, fs.unwatchFile, fileUrl2, common.fail);
106106
check(fs.utimes, fs.utimesSync, fileUrl2, 0, 0);
107107
check(null, fs.watch, fileUrl2, common.fail);
108108
check(null, fs.watchFile, fileUrl2, common.fail);
109-
check(fs.writeFile, fs.writeFileSync, fileUrl2);
109+
check(fs.writeFile, fs.writeFileSync, fileUrl2, 'abc');
110110

111111
// an 'error' for exists means that it doesn't exist.
112112
// one of many reasons why this file is the absolute worst.

0 commit comments

Comments
 (0)