mirror of https://github.com/lukechilds/node.git
Browse Source
This commit adds code coverage for dgram's Socket#send() where the data is an array of strings. PR-URL: https://github.com/nodejs/node/pull/11247 Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>v6.x
cjihrig
8 years ago
committed by
Myles Borins
1 changed files with 13 additions and 0 deletions
@ -0,0 +1,13 @@ |
|||
'use strict'; |
|||
const common = require('../common'); |
|||
const assert = require('assert'); |
|||
const dgram = require('dgram'); |
|||
const socket = dgram.createSocket('udp4'); |
|||
const data = ['foo', 'bar', 'baz']; |
|||
|
|||
socket.on('message', common.mustCall((msg, rinfo) => { |
|||
socket.close(); |
|||
assert.deepStrictEqual(msg.toString(), data.join('')); |
|||
})); |
|||
|
|||
socket.bind(() => socket.send(data, socket.address().port, 'localhost')); |
Loading…
Reference in new issue