1'use strict'; 2 3const common = require('../common'); 4const fixtures = require('../common/fixtures'); 5const fs = require('fs'); 6const readv = require('util').promisify(fs.readv); 7const assert = require('assert'); 8const filepath = fixtures.path('x.txt'); 9const fd = fs.openSync(filepath, 'r'); 10 11const expected = [Buffer.from('xyz\n')]; 12 13readv(fd, expected) 14 .then(function({ bytesRead, buffers }) { 15 assert.deepStrictEqual(bytesRead, expected[0].length); 16 assert.deepStrictEqual(buffers, expected); 17 }) 18 .then(common.mustCall()); 19