Skip to content

Commit

Permalink
Test to cover .recv(Inf) on socket.
Browse files Browse the repository at this point in the history
  • Loading branch information
jnthn committed May 24, 2017
1 parent 89bb970 commit 30e1733
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion S32-io/socket-recv-vs-read.t
@@ -1,7 +1,7 @@
use v6;
use Test;

plan 11;
plan 13;

# Covers RT #126315 (which wanted the right thing of recv) and RT #116288
# (difference between recv and read semantics).
Expand Down Expand Up @@ -54,6 +54,13 @@ is $client.recv(2, :bin).decode('ascii'), 'an',
'recv argument serves as upper limit (bytes)';
$client.close;

$send-rest = Promise.new;
$client = IO::Socket::INET.new(:host("$hostname:$port"));
is $client.recv(Inf), 'first thing', 'recv with Inf works (chars 1)';
$send-rest.keep(True);
is $client.recv(Inf), 'another thing', 'recv with Inf works (chars 2)';
$client.close;

$send-rest = Promise.new;
my $p = start {
$client = IO::Socket::INET.new(:host("$hostname:$port"));
Expand Down

0 comments on commit 30e1733

Please sign in to comment.