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.2 by root, Fri Nov 2 19:20:36 2007 UTC vs.
Revision 1.3 by root, Sat Nov 3 09:35:20 2007 UTC

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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines