diff options
author | Yosuke Furukawa <yosuke.furukawa@gmail.com> | 2015-01-27 02:55:19 +0900 |
---|---|---|
committer | Ben Noordhuis <info@bnoordhuis.nl> | 2015-02-02 18:45:34 +0100 |
commit | 8c0742f43759d35da99f2475f81a026c2818c66a (patch) | |
tree | 388678571a6e9f84c409c463c0f5fa47cbd853ba /test/parallel/test-net-listen-close-server-callback-is-not-function.js | |
parent | 207e48c93459da5e47f2efd408cfad6328bb0e25 (diff) | |
download | android-node-v8-8c0742f43759d35da99f2475f81a026c2818c66a.tar.gz android-node-v8-8c0742f43759d35da99f2475f81a026c2818c66a.tar.bz2 android-node-v8-8c0742f43759d35da99f2475f81a026c2818c66a.zip |
net: check close callback is function
PR-URL: https://github.com/iojs/io.js/pull/609
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Evan Lucas <evanlucas@me.com>
Diffstat (limited to 'test/parallel/test-net-listen-close-server-callback-is-not-function.js')
-rw-r--r-- | test/parallel/test-net-listen-close-server-callback-is-not-function.js | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/test/parallel/test-net-listen-close-server-callback-is-not-function.js b/test/parallel/test-net-listen-close-server-callback-is-not-function.js new file mode 100644 index 0000000000..f4eff77940 --- /dev/null +++ b/test/parallel/test-net-listen-close-server-callback-is-not-function.js @@ -0,0 +1,20 @@ +var assert = require('assert'); +var common = require('../common'); +var net = require('net'); + +var server = net.createServer(assert.fail); +var closeEvents = 0; + +server.on('close', function() { + ++closeEvents; +}); + +server.listen(common.PORT, function() { + assert(false); +}); + +server.close('bad argument'); + +process.on('exit', function() { + assert.equal(closeEvents, 1); +}); |