5 if ($ENV{'PERL_CORE'}){
7 unshift @INC, '../lib';
10 if (! $Config{'useithreads'}) {
11 print("1..0 # Skip: Perl not compiled with 'useithreads'\n");
21 ### Start of Testing ###
23 # Make sure threads are really off
24 ok( !$INC{"threads.pm"} );
26 # Check each faked function.
27 foreach my $func (qw(share cond_wait cond_signal cond_broadcast)) {
28 ok( my $func_ref = __PACKAGE__->can($func) ? 1 : 0 );
31 ok( $@, qr/^Not enough arguments / );
33 my %hash = (foo => 42, bar => 23);
34 eval qq{$func(\%hash)};
40 # These all have no return value.
41 foreach my $func (qw(cond_wait cond_signal cond_broadcast)) {
42 my @array = qw(1 2 3 4);
43 ok( eval qq{$func(\@array)}, undef );
44 ok( "@array", "1 2 3 4" );
47 # share() is supposed to return back it's argument as a ref.
49 my @array = qw(1 2 3 4);
50 ok( share(@array), \@array );
51 ok( ref &share({}), 'HASH' );
52 ok( "@array", "1 2 3 4" );
55 # lock() should be a no-op. The return value is currently undefined.
57 my @array = qw(1 2 3 4);
59 ok( "@array", "1 2 3 4" );