# HG changeset patch # User Sergey Kandaurov # Date 1522063677 -10800 # Node ID 58fdd9515f81b2bf8220c18815a920638951fef6 # Parent 23026106e4397d691d54b75101b3e7c8a7736273 Tests: fixed printing try_run() diagnostics. Previously, error log path could point to junk on unsuccessful regex match. diff --git a/lib/Test/Nginx.pm b/lib/Test/Nginx.pm --- a/lib/Test/Nginx.pm +++ b/lib/Test/Nginx.pm @@ -291,8 +291,8 @@ sub try_run($$) { return $self unless $@; if ($ENV{TEST_NGINX_VERBOSE}) { - $self->{_configure_args} =~ m!--error-log-path=(\S+)!; - my $path = $1 || 'logs/error.log'; + my $path = $self->{_configure_args} =~ m!--error-log-path=(\S+)! + ? $1 : 'logs/error.log'; $path = "$self->{_testdir}/$path" if index($path, '/'); open F, '<', $path or die "Can't open $path: $!";