|
@ -31,7 +31,8 @@ var writeEndOk = false; |
|
|
var file = path.join(common.tmpDir, 'write-end-test.txt'); |
|
|
var file = path.join(common.tmpDir, 'write-end-test.txt'); |
|
|
var stream = fs.createWriteStream(file); |
|
|
var stream = fs.createWriteStream(file); |
|
|
|
|
|
|
|
|
stream.end('a\n', 'utf8', function() { |
|
|
stream.end('a\n', 'utf8'); |
|
|
|
|
|
stream.on('close', function() { |
|
|
var content = fs.readFileSync(file, 'utf8'); |
|
|
var content = fs.readFileSync(file, 'utf8'); |
|
|
assert.equal(content, 'a\n'); |
|
|
assert.equal(content, 'a\n'); |
|
|
writeEndOk = true; |
|
|
writeEndOk = true; |
|
|