81-test_cmp_cli.t: Correct subroutine quote_spc_empty and its use
authorDr. David von Oheimb <David.von.Oheimb@siemens.com>
Tue, 23 Jun 2020 06:04:54 +0000 (08:04 +0200)
committerDr. David von Oheimb <David.von.Oheimb@siemens.com>
Fri, 3 Jul 2020 11:39:20 +0000 (13:39 +0200)
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/12280)

test/recipes/81-test_cmp_cli.t

index 08bc0c956d832979238f81e84d244cab54cb8999..385c259729d925b796ac9ede758566a5b3688424 100644 (file)
@@ -162,8 +162,8 @@ sub test_cmp_cli {
         my $actual_exit = shift;
         my $OK = $actual_exit == $expected_exit;
         if ($faillog && !$OK) {
-            sub quote_spc_empty(_) { $_ eq "" ? '""' : $_ =~ m/ / ? '"'.$_.'"' : $_ };
-            my $invocation = ("$path_app ").join(' ', map quote_spc_empty @$params);
+            my $quote_spc_empty = sub { $_ eq "" ? '""' : $_ =~ m/ / ? '"'.$_.'"' : $_ };
+            my $invocation = "$path_app ".join(' ', map $quote_spc_empty->($_), @$params);
             print $faillog "$server_name $aspect \"$title\" ($i/$n)".
                 " expected=$expected_exit actual=$actual_exit\n";
             print $faillog "$invocation\n\n";