mirror of https://github.com/lukechilds/node.git
Browse Source
This reverts commit 4444e731f2
.
PR-URL: https://github.com/nodejs/node/pull/10809
Reviewed-By: Anna Henningsen <anna@addaleax.net>
v6
Sakthipriyan Vairamani (thefourtheye)
8 years ago
committed by
Anna Henningsen
2 changed files with 5 additions and 28 deletions
@ -1,23 +0,0 @@ |
|||
'use strict'; |
|||
const common = require('../common'); |
|||
const assert = require('assert'); |
|||
const fs = require('fs'); |
|||
const path = require('path'); |
|||
|
|||
const filename = path.join(common.tmpDir, 'readfile.txt'); |
|||
const dataExpected = 'a'.repeat(100); |
|||
fs.writeFileSync(filename, dataExpected); |
|||
const fileLength = dataExpected.length; |
|||
|
|||
['r', 'a+'].forEach((mode) => { |
|||
const fd = fs.openSync(filename, mode); |
|||
assert.strictEqual(fs.readFileSync(fd).length, fileLength); |
|||
|
|||
// Reading again should result in the same length.
|
|||
assert.strictEqual(fs.readFileSync(fd).length, fileLength); |
|||
|
|||
fs.readFile(fd, common.mustCall((err, buf) => { |
|||
assert.ifError(err); |
|||
assert.strictEqual(buf.length, fileLength); |
|||
})); |
|||
}); |
Loading…
Reference in new issue