Skip to content

Commit

Permalink
Merge pull request #496 from jmaslak/get-listening-port-number
Browse files Browse the repository at this point in the history
Tests listening on port 0 returns usable tap with whenever
  • Loading branch information
jmaslak committed Nov 8, 2018
2 parents b9bfe18 + 122e67e commit 2fc3fb6
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion S32-io/IO-Socket-Async.t
@@ -1,7 +1,7 @@
use v6;
use Test;

plan 38;
plan 40;

my $hostname = 'localhost';
my $port = 5000;
Expand Down Expand Up @@ -292,3 +292,15 @@ for '127.0.0.1', '::1' -> $host {
is @first-got.join(""), "hello first", "first server socket got the right message";
is @second-got.join(""), "hello second", "second server socket got the right message";
}

# Rakudo Issue #2411
{
my $listen-socket = IO::Socket::Async.listen("127.0.0.1", 0);
react {
my $listen-tap = do whenever $listen-socket -> $socket { … }
ok $listen-tap.defined, "listen tap is defined";
isa-ok $listen-tap, Tap, "listen tap is a Tap";
done;
}
}

0 comments on commit 2fc3fb6

Please sign in to comment.