Skip to content

Commit c61cead

Browse files
committed
add test for start position
1 parent 4ef448d commit c61cead

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

test/test-sftp.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,12 @@ setup('read (overflow)', mustCall((client, server) => {
105105
if (reqs === 3)
106106
server.end();
107107
}, 3));
108-
client.read(handle_, buf, 0, buf.length, 0, mustCall((err, nb) => {
108+
let reqPos = 0
109+
client.read(handle_, buf, 0, buf.length, reqPos, mustCall((err, nb, retBuf, retPos) => {
109110
assert(!err, `Unexpected read() error: ${err}`);
110111
assert.deepStrictEqual(buf, expected);
111112
assert.strictEqual(nb, buf.length, 'read nb mismatch');
113+
assert.strictEqual(reqPos, retPos, 'read ressource position does not match request');
112114
}));
113115
}));
114116

0 commit comments

Comments
 (0)