Skip to content

Commit

Permalink
test: change to arrow functions in send-bad-arguments
Browse files Browse the repository at this point in the history
PR-URL: #23483
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Shelley Vohr <codebytere@gmail.com>
  • Loading branch information
annatangzhao authored and MylesBorins committed Oct 30, 2018
1 parent 26f356f commit bf20cf8
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions test/parallel/test-dgram-send-bad-arguments.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,17 @@ const buf = Buffer.from('test');
const host = '127.0.0.1';
const sock = dgram.createSocket('udp4');

assert.throws(function() {
assert.throws(() => {
sock.send();
}, TypeError); // First argument should be a buffer.

// send(buf, offset, length, port, host)
assert.throws(function() { sock.send(buf, 1, 1, -1, host); }, RangeError);
assert.throws(function() { sock.send(buf, 1, 1, 0, host); }, RangeError);
assert.throws(function() { sock.send(buf, 1, 1, 65536, host); }, RangeError);
assert.throws(() => { sock.send(buf, 1, 1, -1, host); }, RangeError);
assert.throws(() => { sock.send(buf, 1, 1, 0, host); }, RangeError);
assert.throws(() => { sock.send(buf, 1, 1, 65536, host); }, RangeError);

// send(buf, port, host)
assert.throws(function() { sock.send(23, 12345, host); }, TypeError);
assert.throws(() => { sock.send(23, 12345, host); }, TypeError);

// send([buf1, ..], port, host)
assert.throws(function() { sock.send([buf, 23], 12345, host); }, TypeError);
assert.throws(() => { sock.send([buf, 23], 12345, host); }, TypeError);

0 comments on commit bf20cf8

Please sign in to comment.