mirror of https://github.com/lukechilds/node.git
Browse Source
Refs: 09ebdf1400/lib/dgram.js (L234)
PR-URL: https://github.com/nodejs/node/pull/10901
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
v6
abouthiroppy
8 years ago
committed by
Michaël Zasso
1 changed files with 24 additions and 0 deletions
@ -0,0 +1,24 @@ |
|||
'use strict'; |
|||
require('../common'); |
|||
const assert = require('assert'); |
|||
const dgram = require('dgram'); |
|||
const socket = dgram.createSocket('udp4'); |
|||
|
|||
const errorMessage = |
|||
/^Error: Send takes "offset" and "length" as args 2 and 3$/; |
|||
|
|||
assert.throws(() => { |
|||
socket.sendto(); |
|||
}, errorMessage); |
|||
|
|||
assert.throws(() => { |
|||
socket.sendto('buffer', 1, 'offset', 'port', 'address', 'cb'); |
|||
}, errorMessage); |
|||
|
|||
assert.throws(() => { |
|||
socket.sendto('buffer', 'offset', 1, 'port', 'address', 'cb'); |
|||
}, errorMessage); |
|||
|
|||
assert.throws(() => { |
|||
socket.sendto('buffer', 1, 1, 10, false, 'cb'); |
|||
}, /^Error: udp4 sockets must send to port, address$/); |
Loading…
Reference in new issue