ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/cvsroot/Async-Interrupt/t/01_basic.t
Revision: 1.2
Committed: Thu Jul 2 15:17:57 2009 UTC (17 years, 2 months ago) by root
Content type: application/x-troff
Branch: MAIN
Changes since 1.1: +7 -1 lines
Log Message:
0.02

File Contents

# User Rev Content
1 root 1.2 print "1..9\n"; $|=1;
2 root 1.1
3     use Async::Interrupt;
4    
5     my $ai = new Async::Interrupt
6     cb => sub { print "ok $_[0]\n" };
7    
8 root 1.2 my $ai2 = new Async::Interrupt;
9    
10 root 1.1 print $$ai ? "" : "not ", "ok 1 # $$ai\n";
11    
12     my ($a, $b) = $ai->signal_func;
13    
14     print $a ? "" : "not ", "ok 2 # $a\n";
15     print $b ? "" : "not ", "ok 3 # $b\n";
16    
17     $ai->signal (4);
18    
19 root 1.2 my $ai3 = new Async::Interrupt;
20    
21 root 1.1 print "ok 5\n";
22    
23     $ai->block;
24     $ai->signal (7);
25     print "ok 6\n";
26     $ai->unblock;
27     print "ok 8\n";
28    
29 root 1.2 undef $ai2;
30 root 1.1
31 root 1.2 print "ok 9\n";