Move Test::Simple from lib to ext.
[p5sagit/p5-mst-13.2.git] / ext / 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;
30e302f8 11BEGIN {
b7f9bbeb 12 unless ( $] >= 5.008001 && $Config{'useithreads'} &&
30e302f8 13 eval { require threads; 'threads'->import; 1; })
14 {
b7f9bbeb 15 print "1..0 # Skip: no working threads\n";
30e302f8 16 exit 0;
17 }
a344be10 18}
19
20use strict;
a344be10 21use Test::Builder;
22
23my $Test = Test::Builder->new;
24$Test->exported_to('main');
25$Test->plan(tests => 6);
26
27for(1..5) {
28 'threads'->create(sub {
29 $Test->ok(1,"Each of these should app the test number")
30 })->join;
31}
32
33$Test->is_num($Test->current_test(), 5,"Should be five");