Skip to content

Commit

Permalink
add test for start position
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffrson committed Apr 24, 2022
1 parent 1536f5b commit 5ba3006
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion test/test-sftp.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,12 @@ setup('read (overflow)', mustCall((client, server) => {
if (reqs === 3)
server.end();
}, 3));
client.read(handle_, buf, 0, buf.length, 0, mustCall((err, nb) => {
let reqPos = 0
client.read(handle_, buf, 0, buf.length, reqPos, mustCall((err, nb, retBuf, retPos) => {
assert(!err, `Unexpected read() error: ${err}`);
assert.deepStrictEqual(buf, expected);
assert.strictEqual(nb, buf.length, 'read nb mismatch');
assert.strictEqual(reqPos, retPos, 'read ressource position does not match request');
}));
}));

Expand Down

0 comments on commit 5ba3006

Please sign in to comment.