Permalink
Browse files

[S32-io/IO-Socket-INET.t,.pl] Rakudo fudge 15 tests that alpha passes…

… but master doesn't

git-svn-id: http://svn.pugscode.org/pugs@31245 c213334d-75ef-0310-aa23-eaa082d1ae64
  • Loading branch information...
mberends
mberends committed Jun 13, 2010
1 parent dee3dcf commit a15591d5fc8162d437704521529279e2b522c11b
Showing with 13 additions and 8 deletions.
  1. +4 −3 S32-io/IO-Socket-INET.pl
  2. +9 −5 S32-io/IO-Socket-INET.t
View
@@ -7,9 +7,10 @@
use v6;
-constant PF_INET = 2; # these should move into a file,
-constant SOCK_STREAM = 1; # but what name and directory?
-constant TCP = 6;
+# use Perl 5 style subs for constants until 'constant' works again
+sub PF_INET { 2 } # constant PF_INET = 2; # these should move into a file,
+sub SOCK_STREAM { 1 } # constant SOCK_STREAM = 1; # but what name and directory?
+sub TCP { 6 } # constant TCP = 6;
my ( $test, $port, $server_or_client ) = @*ARGS;
my $host = '127.0.0.1';
View
@@ -36,23 +36,26 @@ given $*OS {
# TODO: other operating systems; *BSD etc.
}
$received = qqx{$netstat_cmd}; # refactor into 1 line after
-if $received ~~ $netstat_pat { @ports = $/[]; } # development complete
+if $received ~~ $netstat_pat { @ports = $/.list; } # development complete
+ # was @ports = $/[] in Rakudo/alpha
+ # @ports = $/[0] also now in master
#warn @ports.elems ~ " PORTS=" ~ @ports;
# sequentially search for the first unused port
my $port = 1024;
while $port < 65535 && $port==any(@ports) { $port++; }
-if $port > 65535 {
+if $port > 65535 {
diag "no free port; abortin";
skip_rest 'No port free - cannot test';
exit 0;
}
diag "Testing on port $port";
# test 1 creates a TCP socket but does not use it.
-constant PF_INET = 2; # these should move into a file,
-constant SOCK_STREAM = 1; # but what name and directory?
-constant TCP = 6;
+# use Perl 5 style subs for constants until 'constant' works again
+sub PF_INET { 2 } # constant PF_INET = 2; # these should move into a file,
+sub SOCK_STREAM { 1 } # constant SOCK_STREAM = 1; # but what name and directory?
+sub TCP { 6 } # constant TCP = 6;
my $server = IO::Socket::INET.socket( PF_INET, SOCK_STREAM, TCP );
isa_ok $server, IO::Socket::INET;
# Do not bind to this socket in the parent process, that would prevent a
@@ -83,6 +86,7 @@ if $*OS eq any <linux darwin solaris MSWin32> { # please add more valid OS names
$expected = "discard '' received\n";
is $received, $expected, "discard server and client";
+ #?rakudo 8 skip
# test 4 tests recv with a parameter
if $is-win {
$received = qqx{t\\spec\\S32-io\\IO-Socket-INET.bat 4 $port};

0 comments on commit a15591d

Please sign in to comment.