Commit | Line | Data |
a344be10 |
1 | #!/usr/bin/perl -w |
3c4bf434 |
2 | # $Id$ |
a344be10 |
3 | |
4 | BEGIN { |
5 | if( $ENV{PERL_CORE} ) { |
6 | chdir 't'; |
7 | @INC = '../lib'; |
8 | } |
9 | } |
10 | |
11 | use Config; |
30e302f8 |
12 | BEGIN { |
b7f9bbeb |
13 | unless ( $] >= 5.008001 && $Config{'useithreads'} && |
30e302f8 |
14 | eval { require threads; 'threads'->import; 1; }) |
15 | { |
b7f9bbeb |
16 | print "1..0 # Skip: no working threads\n"; |
30e302f8 |
17 | exit 0; |
18 | } |
a344be10 |
19 | } |
20 | |
21 | use strict; |
a344be10 |
22 | use Test::Builder; |
23 | |
24 | my $Test = Test::Builder->new; |
25 | $Test->exported_to('main'); |
26 | $Test->plan(tests => 6); |
27 | |
28 | for(1..5) { |
29 | 'threads'->create(sub { |
30 | $Test->ok(1,"Each of these should app the test number") |
31 | })->join; |
32 | } |
33 | |
34 | $Test->is_num($Test->current_test(), 5,"Should be five"); |