changeset 1308:58fdd9515f81

Tests: fixed printing try_run() diagnostics. Previously, error log path could point to junk on unsuccessful regex match.
author Sergey Kandaurov <pluknet@nginx.com>
date Mon, 26 Mar 2018 14:27:57 +0300
parents 23026106e439
children 3eb1de7e3b41
files lib/Test/Nginx.pm
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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: $!";