Merge pull request #4111 from greenify/examples_to_unittest6

std.socket: Examples to unittest [part 6]
This commit is contained in:
Dmitry Olshansky 2016-03-23 20:37:09 +04:00
commit 7fd53776c6

View file

@ -3479,19 +3479,6 @@ class UdpSocket: Socket
* The two sockets are indistinguishable.
*
* Throws: $(D SocketException) if creation of the sockets fails.
*
* Example:
* ---
* immutable ubyte[] data = [1, 2, 3, 4];
* auto pair = socketPair();
* scope(exit) foreach (s; pair) s.close();
*
* pair[0].send(data);
*
* auto buf = new ubyte[data.length];
* pair[1].receive(buf);
* assert(buf == data);
* ---
*/
Socket[2] socketPair() @trusted
{
@ -3533,6 +3520,7 @@ Socket[2] socketPair() @trusted
static assert(false);
}
///
unittest
{
immutable ubyte[] data = [1, 2, 3, 4];