ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/cvsroot/Async-Interrupt/t/01_basic.t
Revision: 1.3
Committed: Thu Jul 2 16:12:40 2009 UTC (17 years, 3 months ago) by root
Content type: application/x-troff
Branch: MAIN
CVS Tags: rel-0_042, rel-0_041, rel-1_25, rel-1_22, rel-0_5, rel-1_23, rel-1_1, rel-1_0, rel-0_501, rel-1_2, rel-1_02, rel-1_03, rel-1_01, rel-1_04, rel-1_05, rel-1_24, rel-0_04, rel-1_26, rel-0_06, rel-1_21, rel-0_03, rel-0_02, HEAD
Changes since 1.2: +9 -1 lines
Log Message:
*** empty log message ***

File Contents

# Content
1 print "1..12\n"; $|=1;
2
3 use Async::Interrupt;
4
5 my $ai = new Async::Interrupt
6 cb => sub { print "ok $_[0]\n" };
7
8 my $ai2 = new Async::Interrupt;
9
10 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 my $ai3 = new Async::Interrupt;
20
21 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 undef $ai2;
30
31 print "ok 9\n";
32
33 {
34 $ai->scope_block;
35 $ai->signal (11);
36 print "ok 10\n";
37 }
38 print "ok 12\n";
39