Mercurial > hg > nginx-tests
comparison lib/Test/Nginx.pm @ 281:53068d38a3ce
Tests: truncate messages to 2048 bytes instead of 4096.
The latter causes TAP parsing problems on CentOS 5 and 6.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Tue, 16 Apr 2013 17:38:11 +0400 |
parents | 6cbcfb4ef7ee |
children | 8fcc46212e5e |
comparison
equal
deleted
inserted
replaced
280:3dd8c7acf3ad | 281:53068d38a3ce |
---|---|
361 return unless $ENV{TEST_NGINX_VERBOSE}; | 361 return unless $ENV{TEST_NGINX_VERBOSE}; |
362 my ($prefix, $msg) = @_; | 362 my ($prefix, $msg) = @_; |
363 ($prefix, $msg) = ('', $prefix) unless defined $msg; | 363 ($prefix, $msg) = ('', $prefix) unless defined $msg; |
364 $prefix .= ' ' if length($prefix) > 0; | 364 $prefix .= ' ' if length($prefix) > 0; |
365 | 365 |
366 if (length($msg) > 4096) { | 366 if (length($msg) > 2048) { |
367 $msg = substr($msg, 0, 4096) | 367 $msg = substr($msg, 0, 2048) |
368 . "(...logged only 4096 of " . length($msg) | 368 . "(...logged only 2048 of " . length($msg) |
369 . " bytes)"; | 369 . " bytes)"; |
370 } | 370 } |
371 | 371 |
372 $msg =~ s/^/# $prefix/gm; | 372 $msg =~ s/^/# $prefix/gm; |
373 $msg =~ s/([^\x20-\x7e])/sprintf('\\x%02x', ord($1)) . (($1 eq "\n") ? "\n" : '')/gmxe; | 373 $msg =~ s/([^\x20-\x7e])/sprintf('\\x%02x', ord($1)) . (($1 eq "\n") ? "\n" : '')/gmxe; |