Skip to content

Commit 1b78937

Browse files
Update rand() unit tests for PCG64
1 parent 2cba38b commit 1b78937

File tree

2 files changed

+5
-11
lines changed

2 files changed

+5
-11
lines changed

t/op/rand.t

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,6 @@ EOM
135135

136136
{ # [perl #115928] use a standard rand() implementation
137137
srand(1);
138-
is(int rand(1000), 41, "our own implementation behaves consistently");
139-
is(int rand(1000), 454, "and still consistently");
138+
is(int rand(1000), 388, "our own implementation behaves consistently");
139+
is(int rand(1000), 616, "and still consistently");
140140
}

t/run/runenv_randseed.t

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ use warnings;
1616
for (1..2) {
1717
local $ENV{PERL_RAND_SEED} = 1;
1818
fresh_perl_is("print map { chr(utf8::unicode_to_native(rand(26)+65)) } 1..10",
19-
"BLVIOAEZTJ", undef, "Test randomness with PERL_RAND_SEED=1");
19+
"KQGIXHIGSJ", undef, "Test randomness with PERL_RAND_SEED=1");
2020
}
2121

2222
for (1..2) {
2323
local $ENV{PERL_RAND_SEED} = 2;
2424
fresh_perl_is("print map { chr(utf8::unicode_to_native(rand(26)+65)) } 1..10",
25-
"XEOUOFRPQZ", undef, "Test randomness with PERL_RAND_SEED=2");
25+
"LSVGRQKRUA", undef, "Test randomness with PERL_RAND_SEED=2");
2626
}
2727

2828
my %got;
@@ -54,13 +54,7 @@ EOF_TEST_CODE
5454
]);
5555
is($err, "", "No exceptions forking.");
5656
my @parts= sort { $a cmp $b } split /\n/, $out;
57-
my @want= (
58-
"A:KNXDITWWJZ",
59-
"B:WDQJGTBJQS",
60-
"C:ZGYCCINIHE",
61-
"D:UGLGAEXFBP",
62-
"E:MQLTNZGZQB"
63-
);
57+
my @want= qw/A:LGLQCODWXB B:DCQOFDFZKK C:FMYATJTNEZ D:VLKWHMYRES E:EEXTFGYHDB/;
6458
is("@parts","@want","Works as expected with forks.");
6559
}
6660

0 commit comments

Comments
 (0)