Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Make is_run evalserver safer.
Before, two test files run in parallel could trample each other's
files. This makes it highly unlikely they will.
  • Loading branch information
jnthn committed Sep 25, 2013
1 parent afaa30d commit c84521b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/Test/Util.pm
Expand Up @@ -64,8 +64,9 @@ multi sub is_run( Str $code, Str $input, %expected, Str $name, *%o ) {
}

sub get_out( Str $code, Str $input?, :@args, :@compiler-args) is export {
my $fnbase = 'getout-';
$fnbase ~= $*PID // 1_000_000.rand.Int;
my $fnbase = 'getout';
$fnbase ~= '-' ~ $*PID if defined $*PID;
$fnbase ~= '-' ~ 1_000_000.rand.Int;

my $clobber = sub ($a, $b) {
my $fh = open $a, :w
Expand Down

0 comments on commit c84521b

Please sign in to comment.