(bufferAsync, bufferSync, expected)
| 30 | const expected = Buffer.from('xyz\n'); |
| 31 | |
| 32 | function test(bufferAsync, bufferSync, expected) { |
| 33 | fs.read(fd, |
| 34 | bufferAsync, |
| 35 | 0, |
| 36 | expected.length, |
| 37 | 0, |
| 38 | common.mustSucceed((bytesRead) => { |
| 39 | assert.strictEqual(bytesRead, expected.length); |
| 40 | assert.deepStrictEqual(bufferAsync, expected); |
| 41 | })); |
| 42 | |
| 43 | const r = fs.readSync(fd, bufferSync, 0, expected.length, 0); |
| 44 | assert.deepStrictEqual(bufferSync, expected); |
| 45 | assert.strictEqual(r, expected.length); |
| 46 | } |
| 47 | |
| 48 | test(Buffer.allocUnsafe(expected.length), |
| 49 | Buffer.allocUnsafe(expected.length), |
no test coverage detected
searching dependent graphs…