mirror of https://github.com/nodejs/node.git
17 lines
413 B
JavaScript
17 lines
413 B
JavaScript
|
var common = require('../common');
|
||
|
var assert = require('assert');
|
||
|
|
||
|
var Stream = require('net').Stream;
|
||
|
|
||
|
var s = new Stream();
|
||
|
|
||
|
// test that destroy called on a stream with a server only ever decrements the
|
||
|
// server connection count once
|
||
|
|
||
|
s.server = { connections: 10 }
|
||
|
assert.equal(10, s.server.connections);
|
||
|
s.destroy()
|
||
|
assert.equal(9, s.server.connections);
|
||
|
s.destroy()
|
||
|
assert.equal(9, s.server.connections);
|