Upgrade to Test-Simple-0.82.
[p5sagit/p5-mst-13.2.git] / lib / Test / Simple / t / threads.t
1 #!/usr/bin/perl -w
2 # $Id: /mirror/googlecode/test-more/t/threads.t 57943 2008-08-18T02:09:22.275428Z brooklyn.kid51  $
3
4 BEGIN {
5     if( $ENV{PERL_CORE} ) {
6         chdir 't';
7         @INC = '../lib';
8     }
9 }
10
11 use Config;
12 BEGIN {
13     unless ( $] >= 5.008001 && $Config{'useithreads'} && 
14              eval { require threads; 'threads'->import; 1; }) 
15     {
16         print "1..0 # Skip: no working threads\n";
17         exit 0;
18     }
19 }
20
21 use strict;
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");