[libanyevent-handle-udp-perl] 37/60: Switch from Test::Exception to Test::Fatal

Jonas Smedegaard js at alioth.debian.org
Mon Sep 30 10:05:43 UTC 2013


This is an automated email from the git hooks/post-receive script.

js pushed a commit to branch master
in repository libanyevent-handle-udp-perl.

commit a55c9154d616d9895e31423529dce04fbbc85450
Author: Leon Timmermans <fawaka at gmail.com>
Date:   Tue Dec 11 02:40:35 2012 +0100

    Switch from Test::Exception to Test::Fatal
---
 Changes        |    1 +
 t/20-timeout.t |    9 ++++-----
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/Changes b/Changes
index a339791..4fd44a8 100644
--- a/Changes
+++ b/Changes
@@ -3,6 +3,7 @@ Revision history for AnyEvent-Handle-UDP
 {{$NEXT}}
           Fix {,r,w}timeout_reset to actually work
           Made it work with old perl+old Socket.pm
+          Switch from Test::Exception to Test::Fatal
 
 0.037     2012-11-15 00:29:31 Europe/Amsterdam
           Handle absence of IPv6 better (hopefully)
diff --git a/t/20-timeout.t b/t/20-timeout.t
index f30c955..6311dc8 100644
--- a/t/20-timeout.t
+++ b/t/20-timeout.t
@@ -3,7 +3,7 @@
 use strict;
 use warnings FATAL => 'all';
 use Test::More 0.89;
-use Test::Exception;
+use Test::Fatal;
 
 use AnyEvent::Handle::UDP;
 use IO::Socket::INET;
@@ -19,16 +19,15 @@ alarm 12;
 		timeout => 3,    on_timeout => sub { $cb->croak("Timeout") },
 		rtimeout => 4.5, on_rtimeout => sub { $cb2->croak("Read Timeout") }
 	);
-	my $client = IO::Socket::INET->new(PeerHost => 'localhost', PeerPort => 1382, Proto => 'udp');
 	my $start_time = AE::now;
-	throws_ok { $cb->recv } qr/Timeout/, 'Receive throws a timeout';
+	like(exception { $cb->recv }, qr/Timeout/, 'Receive throws a timeout');
 	cmp_ok AE::now, '>=', $start_time + 3, 'Three seconds have passed';
-	throws_ok { $cb2->recv } qr/Read Timeout/, 'Receive throws a timeout again';
+	like(exception { $cb2->recv }, qr/Read Timeout/, 'Receive throws a timeout again');
 	cmp_ok AE::now, '>=', $start_time + 4.5, '1.5 more seconds have passed';
 	$server->timeout_reset;
 	my $cb3 = AE::cv;
 	$server->on_timeout(sub { $cb3->croak('Reset') });
-	throws_ok { $cb3->recv } qr/Reset/, 'Receive throws a timeout again';
+	like(exception { $cb3->recv }, qr/Reset/, 'Receive throws a timeout again');
 	cmp_ok AE::now, '>=', $start_time + 7.5, '3 more seconds have passed';
 }
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libanyevent-handle-udp-perl.git



More information about the Pkg-perl-cvs-commits mailing list