X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fglobal_destruction_forked.t;h=05c35e9b924e7c0890b4fd1a21cf760f19bd6bb3;hb=80352025d169218f726e3a0e3ad1ecd226a37596;hp=a533000fbe43404689f5b8b4103e5bcec2da2020;hpb=a88118ec122f664628ded37d59ba0146257def92;p=p5sagit%2FTry-Tiny.git diff --git a/t/global_destruction_forked.t b/t/global_destruction_forked.t index a533000..05c35e9 100644 --- a/t/global_destruction_forked.t +++ b/t/global_destruction_forked.t @@ -18,15 +18,15 @@ use Try::Tiny; package WithFinally; use Try::Tiny; + our $_in_destroy; sub DESTROY { + local $_in_destroy = 1; try {} finally {}; return; } } -my $parent = $$; - try { my $pid = fork; unless ($pid) { @@ -52,6 +52,6 @@ try { waitpid $pid, 0; is $?, 0, 'nested try in cleanup after fork does not maintain outer finally block'; } -finally { exit 1 if $parent != $$ }; +finally { exit 1 if $WithFinally::_in_destroy }; pass("Didn't just exit");