|
| 1 | +From 820803594c31daa2c96921f2d7888c88b1edc97e Mon Sep 17 00:00:00 2001 |
| 2 | +From: Johannes Schindelin < [email protected]> |
| 3 | +Date: Wed, 25 Oct 2023 17:10:17 +0200 |
| 4 | +Subject: [PATCH] test_rand: use the "better chomp" |
| 5 | + |
| 6 | +Following in the footsteps of |
| 7 | +https://github.com/openssl/openssl/commit/9ba96fbb2523cb12747c559c704c58bd8f9e7982 |
| 8 | +(Perl's chop / chomp considered bad, use a regexp instead, 2016-02-11), |
| 9 | +let's not use `chomp()` here because it would leave Carriage Returns in |
| 10 | +place, making the test fail in the MINGW build on Windows. |
| 11 | + |
| 12 | +Signed-off-by: Johannes Schindelin < [email protected]> |
| 13 | +--- |
| 14 | + test/recipes/05-test_rand.t | 4 ++-- |
| 15 | + 1 file changed, 2 insertions(+), 2 deletions(-) |
| 16 | + |
| 17 | +diff --git a/test/recipes/05-test_rand.t b/test/recipes/05-test_rand.t |
| 18 | +index aa012c1..f2c1374 100644 |
| 19 | +--- a/test/recipes/05-test_rand.t |
| 20 | ++++ b/test/recipes/05-test_rand.t |
| 21 | +@@ -28,13 +28,13 @@ SKIP: { |
| 22 | + |
| 23 | + @randdata = run(app(['openssl', 'rand', '-engine', 'ossltest', '-hex', '16' ]), |
| 24 | + capture => 1, statusvar => \$success); |
| 25 | +- chomp(@randdata); |
| 26 | ++ $_ =~ s|\R+$|| for @randdata; |
| 27 | + ok($success && $randdata[0] eq $expected, |
| 28 | + "rand with ossltest: Check rand output is as expected"); |
| 29 | + |
| 30 | + @randdata = run(app(['openssl', 'rand', '-engine', 'dasync', '-hex', '16' ]), |
| 31 | + capture => 1, statusvar => \$success); |
| 32 | +- chomp(@randdata); |
| 33 | ++ $_ =~ s|\R+$|| for @randdata; |
| 34 | + ok($success && length($randdata[0]) == 32, |
| 35 | + "rand with dasync: Check rand output is of expected length"); |
| 36 | + } |
| 37 | +-- |
| 38 | +2.42.0.windows.2 |
| 39 | + |
0 commit comments