Upgrade to Test-Simple-0.82.
[p5sagit/p5-mst-13.2.git] / lib / Test / Simple / t / threads.t
CommitLineData
a344be10 1#!/usr/bin/perl -w
ccbd73a4 2# $Id: /mirror/googlecode/test-more/t/threads.t 57943 2008-08-18T02:09:22.275428Z brooklyn.kid51 $
a344be10 3
4BEGIN {
5 if( $ENV{PERL_CORE} ) {
6 chdir 't';
7 @INC = '../lib';
8 }
9}
10
11use Config;
30e302f8 12BEGIN {
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
21use strict;
a344be10 22use Test::Builder;
23
24my $Test = Test::Builder->new;
25$Test->exported_to('main');
26$Test->plan(tests => 6);
27
28for(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");