user/dev discussion of public-inbox itself
 help / color / mirror / code / Atom feed
Search results ordered by [date|relevance]  view[summary|nested|Atom feed]
thread overview below | download mbox.gz: |
* [PATCH 2/2] t/cgi.t: shorten %ENV setting
  @ 2018-12-29  3:47  7% ` Eric Wong
  0 siblings, 0 replies; 1+ results
From: Eric Wong @ 2018-12-29  3:47 UTC (permalink / raw)
  To: meta

No need to write our own loop when an assignment will do.
---
 t/cgi.t | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/t/cgi.t b/t/cgi.t
index 2e2476d..d92749b 100644
--- 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 {
-- 
EW


^ permalink raw reply related	[relevance 7%]

Results 1-1 of 1 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2018-12-29  3:47     [PATCH 0/2] test cleanups Eric Wong
2018-12-29  3:47  7% ` [PATCH 2/2] t/cgi.t: shorten %ENV setting Eric Wong

Code repositories for project(s) associated with this public inbox

	https://80x24.org/public-inbox.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).