]> Sergey Matveev's repositories - public-inbox.git/commitdiff
t/cgi.t: shorten %ENV setting
authorEric Wong <e@80x24.org>
Fri, 28 Dec 2018 06:26:05 +0000 (06:26 +0000)
committerEric Wong <e@80x24.org>
Sat, 29 Dec 2018 03:46:12 +0000 (03:46 +0000)
No need to write our own loop when an assignment will do.

t/cgi.t

diff --git a/t/cgi.t b/t/cgi.t
index 2e2476d78bf24f8a0fe01bed27258a30cf876285..d92749b3d98ec52053dab204134207ff210c4c6c 100644 (file)
--- a/t/cgi.t
+++ b/t/cgi.t
@@ -217,8 +217,7 @@ done_testing();
 
 sub run_with_env {
        my ($env, @args) = @_;
-       my $init = sub { foreach my $k (keys %$env) { $ENV{$k} = $env->{$k} } };
-       IPC::Run::run(@args, init => $init);
+       IPC::Run::run(@args, init => sub { %ENV = (%ENV, %$env) });
 }
 
 sub cgi_run {