mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 10:59:27 +00:00
8e080c14cf
PR-URL: https://github.com/nodejs/node/pull/33590 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Robert Nagy <ronagy@icloud.com> Reviewed-By: Zeyu Yang <himself65@outlook.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
19 lines
536 B
JavaScript
19 lines
536 B
JavaScript
'use strict';
|
|
|
|
const common = require('../common');
|
|
const fixtures = require('../common/fixtures');
|
|
const fs = require('fs');
|
|
const readv = require('util').promisify(fs.readv);
|
|
const assert = require('assert');
|
|
const filepath = fixtures.path('x.txt');
|
|
const fd = fs.openSync(filepath, 'r');
|
|
|
|
const expected = [Buffer.from('xyz\n')];
|
|
|
|
readv(fd, expected)
|
|
.then(function({ bytesRead, buffers }) {
|
|
assert.deepStrictEqual(bytesRead, expected[0].length);
|
|
assert.deepStrictEqual(buffers, expected);
|
|
})
|
|
.then(common.mustCall());
|