Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The shared nature of a scalar value, in this case $self->{Curr_Test} is lost across a simple hash copy as subtest() was doing. So we reshare them on copy. For #145 Signed-off-by: Michael G. Schwern <schwern@pobox.com>
- Loading branch information
Showing
3 changed files
with
61 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/usr/bin/perl -w | ||
|
||
use strict; | ||
use warnings; | ||
|
||
use Config; | ||
BEGIN { | ||
unless ( $] >= 5.008001 && $Config{'useithreads'} && | ||
eval { require threads; 'threads'->import; 1; }) | ||
{ | ||
print "1..0 # Skip: no working threads\n"; | ||
exit 0; | ||
} | ||
} | ||
|
||
use Test::More; | ||
|
||
subtest 'simple test with threads on' => sub { | ||
is( 1+1, 2, "simple test" ); | ||
is( "a", "a", "another simple test" ); | ||
}; | ||
|
||
pass("Parent retains sharedness"); | ||
|
||
done_testing(2); |