Skip to content

Commit 0f3a42c

Browse files
committed
random: test: fix test
1 parent 4e41f01 commit 0f3a42c

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

ext/random/tests/03_randomizer/basic.phpt

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,7 @@ foreach ($engines as $engine) {
3333
$randomizer->nextInt();
3434
} catch (\RuntimeException $e) {
3535
if ($e->getMessage() !== 'Generated value exceeds size of int') {
36-
die($engine::class . ': nextInt: failure: {$e->getMesasge()}');
37-
throw $e;
36+
die($engine::class . ": nextInt: failure: {$e->getMessage()}");
3837
}
3938
}
4039
}
@@ -51,7 +50,7 @@ foreach ($engines as $engine) {
5150
for ($i = 0; $i < 1000; $i++) {
5251
$length = \random_int(1, 1024);
5352
if (\strlen($randomizer->getBytes($length)) !== $length) {
54-
die($engine::class . ': getBytes: failure.');
53+
die($engine::class . ': getBytes: failure');
5554
}
5655
}
5756

@@ -65,14 +64,14 @@ foreach ($engines as $engine) {
6564
}
6665
}
6766

68-
die($engine::class . ': shuffleArray: failure.');
67+
die($engine::class . ': shuffleArray: failure');
6968
})();
7069

7170
// shuffleBytes
7271
$string = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.';
7372
$shuffled_string = $randomizer->shuffleBytes($string);
7473
if ($string === $shuffled_string) {
75-
die($engine::class . ': shuffleBytes: failure.');
74+
die($engine::class . ': shuffleBytes: failure');
7675
}
7776
}
7877

0 commit comments

Comments
 (0)