ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/AnyEvent/t/02_signals.t
(Generate patch)

Comparing AnyEvent/t/02_signals.t (file contents):
Revision 1.1 by root, Sun Dec 10 23:59:15 2006 UTC vs.
Revision 1.5 by root, Fri May 23 16:36:02 2008 UTC

1$|=1; 1$|=1;
2BEGIN { print "1..5\n" } 2BEGIN {
3 print "1..5\n";
4}
3 5
4use AnyEvent; 6use AnyEvent;
7use AnyEvent::Impl::Perl;
5 8
6print "ok 1\n"; 9print "ok 1\n";
7 10
8my $cv = AnyEvent->condvar; 11my $cv = AnyEvent->condvar;
9 12
13my $error = AnyEvent->timer (after => 5, cb => sub {
14 print <<EOF;
15Bail out! No signal caught.
16EOF
17 exit 0;
18});
19
10my $sw = AnyEvent->signal (signal => 'CHLD', cb => sub { 20my $sw = AnyEvent->signal (signal => 'INT', cb => sub {
11 print "ok 3\n"; 21 print "ok 3\n";
12 $cv->broadcast; 22 $cv->broadcast;
13}); 23});
14 24
15print "ok 2\n"; 25print "ok 2\n";
16kill 'CHLD', 0; 26kill 'INT', $$;
17$cv->wait; 27$cv->wait;
28undef $error;
29
30print "ok 4\n";
18 31
19undef $sw; 32undef $sw;
20 33
21print "ok 4\n"; 34print "ok 5\n";
22 35
23kill 'CHLD', 0;
24
25print "ok 5\n";

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines