mirror of https://github.com/lukechilds/node.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
611 B
22 lines
611 B
14 years ago
|
var common = require('../common');
|
||
|
var assert = require('assert');
|
||
12 years ago
|
var path = require('path');
|
||
|
var fs = require('fs');
|
||
14 years ago
|
|
||
|
(function() {
|
||
12 years ago
|
var file = path.join(common.tmpDir, 'write-end-test0.txt');
|
||
14 years ago
|
var stream = fs.createWriteStream(file);
|
||
12 years ago
|
stream.end();
|
||
|
stream.on('close', common.mustCall(function() { }));
|
||
|
})();
|
||
14 years ago
|
|
||
12 years ago
|
(function() {
|
||
|
var file = path.join(common.tmpDir, 'write-end-test1.txt');
|
||
|
var stream = fs.createWriteStream(file);
|
||
12 years ago
|
stream.end('a\n', 'utf8');
|
||
12 years ago
|
stream.on('close', common.mustCall(function() {
|
||
14 years ago
|
var content = fs.readFileSync(file, 'utf8');
|
||
|
assert.equal(content, 'a\n');
|
||
12 years ago
|
}));
|
||
14 years ago
|
})();
|