Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorGil Pedersen <git@gpost.dk>2012-08-01 18:04:28 +0400
committerBen Noordhuis <info@bnoordhuis.nl>2012-08-02 03:25:53 +0400
commitf1fba8d1f5e7411f055c00ca4b46646e5b840cf2 (patch)
tree072e4d7e393ed994bfdca61716f927fa120ec2a7 /test
parent23f09d7e024f326ea0466af10b97ad46e76ac5e6 (diff)
fs: fix ReadStream / WriteStream missing callback
The (undocumented) callback argument to .destroy() was not called if the stream was no longer readable / writable.
Diffstat (limited to 'test')
-rw-r--r--test/simple/test-fs-read-stream.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/test/simple/test-fs-read-stream.js b/test/simple/test-fs-read-stream.js
index dbb5fbf8473..d500fc45ea8 100644
--- a/test/simple/test-fs-read-stream.js
+++ b/test/simple/test-fs-read-stream.js
@@ -86,6 +86,11 @@ var file2 = fs.createReadStream(fn);
file2.destroy(function(err) {
assert.ok(!err);
callbacks.destroy++;
+
+ file2.destroy(function(err) {
+ assert.ok(!err);
+ callbacks.destroy++;
+ });
});
var file3 = fs.createReadStream(fn, {encoding: 'utf8'});
@@ -107,7 +112,7 @@ file3.on('close', function() {
process.on('exit', function() {
assert.equal(1, callbacks.open);
assert.equal(1, callbacks.end);
- assert.equal(1, callbacks.destroy);
+ assert.equal(2, callbacks.destroy);
assert.equal(2, callbacks.close);