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

Comparing AnyEvent/t/03_child.t (file contents):
Revision 1.6 by root, Sun Nov 25 13:53:04 2007 UTC vs.
Revision 1.7 by root, Sun Nov 25 14:08:12 2007 UTC

19 print "ok 2\n"; 19 print "ok 2\n";
20 exit 3; 20 exit 3;
21} 21}
22 22
23my $w = AnyEvent->child (pid => $pid, cb => sub { 23my $w = AnyEvent->child (pid => $pid, cb => sub {
24 print $pid == $_[0] ? "" : "not ", "ok 3\n"; 24 print $pid == $_[0] ? "" : "not ", "ok 3\ # $pid == $_[0]\n";
25 print 3 == ($_[1] >> 8) ? "" : "not ", "ok 4\n"; 25 print 3 == ($_[1] >> 8) ? "" : "not ", "ok 4 # 3 == $_[1] >> 8 ($_[1])\n";
26 $cv->broadcast; 26 $cv->broadcast;
27}); 27});
28 28
29$cv->wait; 29$cv->wait;
30 30
31my $pid2 = fork || exit 7; 31my $pid2 = fork || exit 7;
32 32
33my $cv2 = AnyEvent->condvar; 33my $cv2 = AnyEvent->condvar;
34 34
35my $w2 = AnyEvent->child (pid => 0, cb => sub { 35my $w2 = AnyEvent->child (pid => 0, cb => sub {
36 print $pid2 == $_[0] ? "" : "not ", "ok 5\n"; 36 print $pid2 == $_[0] ? "" : "not ", "ok 5 # $pid2 == $_[0]\n";
37 print 7 == ($_[1] >> 8) ? "" : "not ", "ok 6\n"; 37 print 7 == ($_[1] >> 8) ? "" : "not ", "ok 6 # 7 == $_[1] >> 8 ($_[1])\n";
38 $cv2->broadcast; 38 $cv2->broadcast;
39}); 39});
40 40
41$cv2->wait; 41$cv2->wait;
42 42

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines