ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/Coro/Event/t/01_unblock.t
Revision: 1.1
Committed: Tue Nov 6 23:33:26 2001 UTC (22 years, 8 months ago) by root
Content type: application/x-troff
Branch: MAIN
Log Message:
*** empty log message ***

File Contents

# User Rev Content
1 root 1.1 BEGIN { $| = 1; print "1..12\n"; }
2    
3     use Coro;
4     use Coro::Event;
5     use Coro::Handle;
6    
7     print "ok 1\n";
8    
9     pipe my ($r, $w) or die;
10    
11     print "ok 2\n";
12    
13     $r = unblock $r;
14     $w = unblock $w;
15    
16     print "ok 3\n";
17    
18     async {
19     print "ok 5\n";
20    
21     do_timer(after => 0.001);
22    
23     print "ok 7\n";
24    
25     print $w "13\n";
26    
27     print "ok 8\n";
28    
29     $w->print($buf, "x" x (1024*128));
30    
31     print "ok 10\n";
32    
33     print $w "77\n";
34     close $w;
35     };
36    
37     print "ok 4\n";
38    
39     cede;
40    
41     print "ok 6\n";
42    
43     print <$r> == 13 ? "" : "not ", "ok 9\n";
44    
45     $r->read($buf, 1024*128);
46    
47     print "ok 11\n";
48    
49     print <$r> == 77 ? "" : "not ", "ok 12\n";
50    
51