Skip to content

Commit

Permalink
test: add "mustCall" for test-net-buffersize
Browse files Browse the repository at this point in the history
PR-URL: #27451
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
Reviewed-By: Weijia Wang <starkwang@126.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Yorkie Liu <yorkiefixer@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ouyang Yadong <oyydoibh@gmail.com>
  • Loading branch information
lixin.atom authored and targos committed Apr 29, 2019
1 parent d784ecb commit e8d5b62
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions test/parallel/test-net-buffersize.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
// USE OR OTHER DEALINGS IN THE SOFTWARE.

'use strict';
require('../common');
const common = require('../common');
const assert = require('assert');
const net = require('net');

Expand All @@ -36,17 +36,17 @@ const server = net.createServer(function(socket) {
});
});

server.listen(0, function() {
server.listen(0, common.mustCall(function() {
const client = net.connect(this.address().port);

client.on('finish', function() {
client.on('finish', common.mustCall(() => {
assert.strictEqual(client.bufferSize, 0);
});
}));

for (let i = 1; i < iter; i++) {
client.write('a');
assert.strictEqual(client.bufferSize, i);
}

client.end();
});
}));

0 comments on commit e8d5b62

Please sign in to comment.