diff debug_connection_syslog.t @ 1127:6620cd57a96a

Tests: replaced all occurrences of vec/select API with IO::Select.
author Sergey Kandaurov <pluknet@nginx.com>
date Fri, 10 Feb 2017 12:41:43 +0300
parents a04323ab0622
children bef8be8a6224
line wrap: on
line diff
--- a/debug_connection_syslog.t
+++ b/debug_connection_syslog.t
@@ -11,6 +11,8 @@ use strict;
 
 use Test::More;
 
+use IO::Select;
+
 BEGIN { use FindBin; chdir($FindBin::Bin); }
 
 use lib 'lib';
@@ -69,7 +71,6 @@ is($msgs[0], $msgs[1], 'debug_connection
 sub get_syslog {
 	my ($uri, @port) = @_;
 	my (@s);
-	my $rfd = '';
 	my @data;
 
 	eval {
@@ -94,11 +95,8 @@ sub get_syslog {
 
 	map {
 		my $data = '';
-		vec($rfd, fileno($_), 1) = 1;
-		select $rfd, undef, undef, 1;
-		while (select($rfd, undef, undef, 0.1) > 0
-			&& vec($rfd, fileno($_), 1))
-		{
+		IO::Select->new($_)->can_read(1);
+		while (IO::Select->new($_)->can_read(0.1)) {
 			my ($buffer);
 			sysread($_, $buffer, 4096);
 			$data .= $buffer;