Test-Stream

 view release on metacpan or  search on metacpan

t/modules/Hub.t  view on Meta::CPAN

            ok(!$?, "child exited with success");
            $hub->cull();
            $do_check->('Fork');
        }
        else {
            $do_send->();
            exit 0;
        }
    }

    if (CAN_THREAD && $] ge '5.010') {
        require threads;
        my $thr = threads->new(sub { $do_send->() });
        $thr->join;
        $hub->cull();
        $do_check->('Threads');
    }

    $do_send->();
    $hub->cull();
    $do_check->('no IPC');

t/modules/Sync.t  view on Meta::CPAN

        die "Failed to fork!" unless defined $pid;
        unless($pid) { exit 255 }
        my @warnings;
        {
            local $SIG{__WARN__} = sub { push @warnings => @_ };
            def is => ($sync->_ipc_wait, 255, "Process exited badly");
        }
        def like => (\@warnings, [qr/Process .* did not exit cleanly \(status: 255\)/], "Warn about exit");
    }

    if (CAN_THREAD && $] ge '5.010') {
        require threads;
        $reset->();

        threads->new(sub { 1 });
        def is => ($sync->_ipc_wait, 0, "No errors");

        if (threads->can('error')) {
            threads->new(sub {
                close(STDERR);
                close(STDOUT);



( run in 1.803 second using v1.01-cache-2.11-cpan-cc502c75498 )