AE-AdHoc

 view release on metacpan or  search on metacpan

t/13-null-timeout.t  view on Meta::CPAN

#!/usr/bin/perl -w

use strict;
use Test::More;
use Test::Exception;

use AE::AdHoc;

my @warn;
$SIG{__WARN__} = sub { push @warn, shift };

plan tests => 4;

throws_ok {
	ae_recv{ };
} qr(timeout.*non-?zero), "No timeout = no go";

throws_ok {
	ae_recv{ } "foo";
} qr(timeout.*non-?zero), "Non-numeric timeout = no go";

throws_ok {
	ae_recv{ } 0.01;
} qr(^Timeout after), "Timeout with empty body";

is (scalar @warn, 0, "no warnings");
note "warning: $_" for @warn;

 view all matches for this distribution
 view release on metacpan -  search on metacpan

( run in 1.292 second using v1.00-cache-2.02-grep-82fe00e-cpan-d29e8ade9f55 )