From: Vincent Pit Date: Sat, 8 Sep 2012 23:05:20 +0000 (+0200) Subject: Make t/85-stress-unwind.t predictable X-Git-Tag: v0.20~24 X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2FScope-Upper.git;a=commitdiff_plain;h=d3fe85111edf0d4cbd702f67eea3bf359bd8b485 Make t/85-stress-unwind.t predictable --- diff --git a/t/85-stress-unwind.t b/t/85-stress-unwind.t index 8ee79c6..acd4452 100644 --- a/t/85-stress-unwind.t +++ b/t/85-stress-unwind.t @@ -51,6 +51,9 @@ sub contextify { } } +my $integer = 0; +my $items = 0; + sub gen { my ($height, $level, $i) = @_; push @_, $i = 0 if @_ == 2; @@ -65,7 +68,7 @@ sub gen { $blk->[0] . $cx->[0] . $code . $cx->[1] . $blk->[1], contextify($cx->[2], $active, $exp), ]; - my @items = map { int rand 10 } 0 .. rand 3; + my @items = map $integer++, 0 .. ($items++ % 3); my $list = join ', ', @items; push @res, [ $blk->[0] . $cx->[0] . "($list, $code)" . $cx->[1] . $blk->[1],