Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: update comments in test-fs-read-offset-null #36152

Merged
merged 1 commit into from Nov 21, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 4 additions & 5 deletions test/parallel/test-fs-read-offset-null.js
Expand Up @@ -12,17 +12,16 @@ const fixtures = require('../common/fixtures');
const filepath = fixtures.path('x.txt');

const buf = Buffer.alloc(1);
// Reading only one character, hence buffer of one byte is enough
// Reading only one character, hence buffer of one byte is enough.

// Test for callback api
// Test for callback API.
fs.open(filepath, 'r', common.mustSucceed((fd) => {
fs.read(fd, { offset: null, buffer: buf },
common.mustSucceed((bytesRead, buffer) => {
assert.strictEqual(buffer[0], 120);
// Test is done by making sure the first letter in buffer is
// same as first letter in file.
// 66 is the hex for ascii code of letter B

// 120 is the hex for ascii code of letter x.
assert.strictEqual(buffer[0], 120);
fs.close(fd, common.mustSucceed(() => {}));
}));
}));
Expand Down