Clean up dgram tests and wrap in namespace

This commit is contained in:
TonyYang
2016-09-08 12:53:47 +08:00
committed by GitHub
parent 01a3adcdb6
commit 50c18f1198

View File

@@ -588,14 +588,16 @@ namespace tty_tests {
/// Dgram tests : http://nodejs.org/api/dgram.html
////////////////////////////////////////////////////
var ds: dgram.Socket = dgram.createSocket("udp4", (msg: Buffer, rinfo: dgram.RemoteInfo): void => {
});
ds.bind();
ds.bind(41234);
var ai: dgram.AddressInfo = ds.address();
ds.send(new Buffer("hello"), 0, 5, 5000, "127.0.0.1", (error: Error, bytes: number): void => {
});
ds.send(new Buffer("hello"), 5000, "127.0.0.1");
namespace dgram_tests {
var ds: dgram.Socket = dgram.createSocket("udp4", (msg: Buffer, rinfo: dgram.RemoteInfo): void => {
});
ds.bind();
ds.bind(41234);
var ai: dgram.AddressInfo = ds.address();
ds.send(new Buffer("hello"), 0, 5, 5000, "127.0.0.1", (error: Error, bytes: number): void => {
});
ds.send(new Buffer("hello"), 5000, "127.0.0.1");
}
////////////////////////////////////////////////////
///Querystring tests : https://nodejs.org/api/querystring.html