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 79ba863

Browse filesBrowse files
Patrick HeneiseMylesBorins
authored andcommitted
test: fs.write() if 3rd argument is a callback, not offset
Easier way to resolve conflicts from #16822 and #16827. PR-URL: #17045 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
1 parent 4b35dfb commit 79ba863
Copy full SHA for 79ba863

File tree

Expand file treeCollapse file tree

1 file changed

+13
-0
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+13
-0
lines changed
Open diff view settings
Collapse file

‎test/parallel/test-fs-write.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-fs-write.js
+13Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ const path = require('path');
2626
const fs = require('fs');
2727
const fn = path.join(common.tmpDir, 'write.txt');
2828
const fn2 = path.join(common.tmpDir, 'write2.txt');
29+
const fn3 = path.join(common.tmpDir, 'write3.txt');
2930
const expected = 'ümlaut.';
3031
const constants = fs.constants;
3132

@@ -73,3 +74,15 @@ fs.open(fn2, args, 0o644, common.mustCall((err, fd) => {
7374
fs.write(fd, '', 0, 'utf8', written);
7475
fs.write(fd, expected, 0, 'utf8', done);
7576
}));
77+
78+
fs.open(fn3, 'w', 0o644, common.mustCall(function(err, fd) {
79+
assert.ifError(err);
80+
81+
const done = common.mustCall(function(err, written) {
82+
assert.ifError(err);
83+
assert.strictEqual(Buffer.byteLength(expected), written);
84+
fs.closeSync(fd);
85+
});
86+
87+
fs.write(fd, expected, done);
88+
}));

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.