--- AnyEvent/t/03_child.t 2007/11/02 19:20:36 1.2 +++ AnyEvent/t/03_child.t 2007/11/09 19:34:32 1.4 @@ -1,5 +1,5 @@ $|=1; -BEGIN { print "1..5\n" } +BEGIN { print "1..7\n" } use AnyEvent; @@ -20,24 +20,26 @@ } my $w = AnyEvent->child (pid => $pid, cb => sub { - print 3 == ($? >> 8) ? "" : "not ", "ok 3\n"; + print $pid == $_[0] ? "" : "not ", "ok 3\n"; + print 3 == ($_[1] >> 8) ? "" : "not ", "ok 4\n"; $cv->broadcast; }); $cv->wait; -fork || exit 7; +my $pid2 = fork || exit 7; my $cv2 = AnyEvent->condvar; my $w2 = AnyEvent->child (pid => 0, cb => sub { - print 7 == ($? >> 8) ? "" : "not ", "ok 4\n"; + print $pid2 == $_[0] ? "" : "not ", "ok 5\n"; + print 7 == ($_[1] >> 8) ? "" : "not ", "ok 6\n"; $cv2->broadcast; }); $cv2->wait; -print "ok 5\n"; +print "ok 7\n";