Retract #20548 and #20465.
[p5sagit/p5-mst-13.2.git] / lib / Test / Simple / t / threads.t
CommitLineData
a344be10 1#!/usr/bin/perl -w
2
3BEGIN {
4 if( $ENV{PERL_CORE} ) {
5 chdir 't';
6 @INC = '../lib';
7 }
8}
9
10use Config;
60ffb308 11unless ($Config{'useithreads'} and eval { require threads; 1 }) {
a344be10 12 print "1..0 # Skip: no threads\n";
13 exit 0;
14}
15
16use strict;
17require threads;
18use Test::Builder;
19
20my $Test = Test::Builder->new;
21$Test->exported_to('main');
22$Test->plan(tests => 6);
23
24for(1..5) {
25 'threads'->create(sub {
26 $Test->ok(1,"Each of these should app the test number")
27 })->join;
28}
29
30$Test->is_num($Test->current_test(), 5,"Should be five");