summaryrefslogtreecommitdiffstats
path: root/gnu/usr.bin/perl/cpan/Test-Simple/t/Legacy/Regression/683_thread_todo.t
blob: c5eb7cb629faa00c4d55dab8417eac3ee5970d51 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
use strict;
use warnings;

use Test2::Util qw/CAN_THREAD/;
BEGIN {
    unless(CAN_THREAD) {
        require Test::More;
        Test::More->import(skip_all => "threads are not supported");
    }
}

use threads;
use Test::More;

my $t = threads->create(
    sub {
        local $TODO = "Some good reason";

        fail "Crap";

        42;
    }
);

is(
    $t->join,
    42,
    "Thread exitted successfully"
);

done_testing;