blob: 4c256207deb476fd9a9fc7521b75362d713ad7d8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
var common = require('../common');
var assert = require('assert');
var path = require('path'),
fs = require('fs');
var writeEndOk = false;
(function() {
debugger;
var file = path.join(common.tmpDir, 'write-end-test.txt');
var stream = fs.createWriteStream(file);
stream.end('a\n', 'utf8', function() {
var content = fs.readFileSync(file, 'utf8');
assert.equal(content, 'a\n');
writeEndOk = true;
});
})();
process.on('exit', function() {
assert.ok(writeEndOk);
});
|