Permalink
Browse files

test that we get different results when re-running interpreter

Random number generator wasnt initialized with a random seed.
See https://rt.perl.org/rt3/Ticket/Display.html?id=89972
  • Loading branch information...
1 parent 266acab commit 6320c7c2de45a568311175a9eefb50a7944f7e00 @FROGGS FROGGS committed Nov 20, 2012
Showing with 9 additions and 1 deletion.
  1. +9 −1 S32-list/roll.t
View
@@ -2,7 +2,7 @@ use v6;
use Test;
-plan 39;
+plan 40;
=begin description
@@ -121,4 +121,12 @@ is (0, 1).roll(*).[^10].elems, 10, '.roll(*) returns at least ten elements';
is (1..^2).roll, 1, '1-elem Range roll';
ok ('a' .. 'z').roll ~~ /\w/, 'Str-Range roll';
+# RT 89972
+{
+ my $a = qqx{$*EXECUTABLE_NAME -e "print ~(1..10).pick(5)"};
+ my $b = qqx{$*EXECUTABLE_NAME -e "print ~(1..10).pick(5)"};
+ my $c = qqx{$*EXECUTABLE_NAME -e "print ~(1..10).pick(5)"};
+ ok ($a leg $b || $b leg $c), 'different results due to random random-number seed';
+}
+
# vim: ft=perl6

0 comments on commit 6320c7c

Please sign in to comment.