[nginx-tests] Tests: style, wrapped to avoid lines longer than 8...

Maxim Dounin mdounin at mdounin.ru
Sat Jul 18 17:13:26 UTC 2026


details:   http://freenginx.org/hg/nginx-tests/rev/93e99c000eb9
branches:  
changeset: 2078:93e99c000eb9
user:      Maxim Dounin <mdounin at mdounin.ru>
date:      Sat Jul 18 20:10:43 2026 +0300
description:
Tests: style, wrapped to avoid lines longer than 80 chars.

diffstat:

 h2.t                    |   3 ++-
 h2_request_body.t       |   6 ++++--
 h3_headers.t            |   3 ++-
 http_try_files.t        |  24 ++++++++++++++++--------
 lib/Test/Nginx.pm       |   3 ++-
 mail_imap.t             |   6 ++++--
 proxy_xar.t             |   3 ++-
 ssl.t                   |   3 ++-
 stream_udp_limit_conn.t |   3 ++-
 sub_filter_perl.t       |   9 ++++++---
 10 files changed, 42 insertions(+), 21 deletions(-)

diffs (194 lines):

diff --git a/h2.t b/h2.t
--- a/h2.t
+++ b/h2.t
@@ -604,7 +604,8 @@ ok($frame, 'client header timeout - PING
 # the rest of frame is received after client header timeout
 
 $s = Test::Nginx::HTTP2->new(port(8087));
-$sid = $s->new_stream({ path => '/t2.html', split => [20], split_delay => 2.1 });
+$sid = $s->new_stream({ path => '/t2.html', split => [20],
+	split_delay => 2.1 });
 $frames = $s->read(all => [{ type => 'RST_STREAM' }]);
 
 ($frame) = grep { $_->{type} eq "RST_STREAM" } @$frames;
diff --git a/h2_request_body.t b/h2_request_body.t
--- a/h2_request_body.t
+++ b/h2_request_body.t
@@ -213,7 +213,8 @@ is($frame->{code}, 0, 'request body disc
 $frames = $s->read(all => [{ sid => $sid, fin => 1 }]);
 
 ($frame) = grep { $_->{type} eq "HEADERS" } @$frames;
-is($frame->{headers}->{':status'}, 400, 'request body less than content-length');
+is($frame->{headers}->{':status'}, 400,
+	'request body less than content-length');
 
 $sid = $s->new_stream({ body => 'TEST', headers => [
 	{ name => ':method', value => 'GET', mode => 0 },
@@ -224,7 +225,8 @@ is($frame->{headers}->{':status'}, 400, 
 $frames = $s->read(all => [{ sid => $sid, fin => 1 }]);
 
 ($frame) = grep { $_->{type} eq "HEADERS" } @$frames;
-is($frame->{headers}->{':status'}, 400, 'request body more than content-length');
+is($frame->{headers}->{':status'}, 400,
+	'request body more than content-length');
 
 # client_max_body_size
 
diff --git a/h3_headers.t b/h3_headers.t
--- a/h3_headers.t
+++ b/h3_headers.t
@@ -731,7 +731,8 @@ is($frame->{headers}->{':status'}, 400, 
 ($frame) = grep { $_->{type} eq "HEADERS" } @$frames;
 isnt($frame->{headers}->{'x-referer'}, 'see-this', 'newline in request header');
 
-is($frame->{headers}->{':status'}, 400, 'newline in request header - bad request');
+is($frame->{headers}->{':status'}, 400,
+	'newline in request header - bad request');
 
 # invalid header name as seen with underscore should not lead to ignoring rest
 
diff --git a/http_try_files.t b/http_try_files.t
--- a/http_try_files.t
+++ b/http_try_files.t
@@ -235,27 +235,35 @@ like(http_get('/notfound'), qr!404 Not!,
 
 like(http_get('/alias/found.html'), qr!SEE THIS!, 'alias $uri');
 like(http_get('/alias/found'), qr!SEE THIS!, 'alias $uri.html');
-like(http_get('/alias/directory'), qr!301 Moved Permanently!, 'alias $uri/ redirect');
+like(http_get('/alias/directory'), qr!301 Moved Permanently!,
+	'alias $uri/ redirect');
 like(http_get('/alias/directory/'), qr!SEE THIS!, 'alias $uri/ index');
 like(http_get('/alias/notfound'), qr!404 Not!, 'alias not found');
 
 like(http_get('/alias-re-add/found.html'), qr!SEE THIS!, 'alias regex ""');
 like(http_get('/alias-re-add/found'), qr!SEE THIS!, 'alias regex .html');
-like(http_get('/alias-re-add/directory'), qr!301 Moved Permanently!, 'alias regex / redirect');
-like(http_get('/alias-re-add/directory/'), qr!SEE THIS!, 'alias regex / index');
+like(http_get('/alias-re-add/directory'), qr!301 Moved Permanently!,
+	'alias regex / redirect');
+like(http_get('/alias-re-add/directory/'), qr!SEE THIS!,
+	'alias regex / index');
 like(http_get('/alias-re-add/notfound'), qr!404 Not!, 'alias regex not found');
 
 TODO: {
 local $TODO = 'not yet' unless $t->has_version('1.31.0');
 
-like(http_get('/alias-re-prefix/found.html'), qr!SEE THIS!, 'alias regex $uri');
-like(http_get('/alias-re-prefix/found'), qr!SEE THIS!, 'alias regex $uri.html');
-like(http_get('/alias-re-prefix/directory'), qr!301 Moved Permanently!, 'alias regex $uri/ redirect');
-like(http_get('/alias-re-prefix/directory/'), qr!SEE THIS!, 'alias regex $uri/ index');
+like(http_get('/alias-re-prefix/found.html'), qr!SEE THIS!,
+	'alias regex $uri');
+like(http_get('/alias-re-prefix/found'), qr!SEE THIS!,
+	'alias regex $uri.html');
+like(http_get('/alias-re-prefix/directory'), qr!301 Moved Permanently!,
+	'alias regex $uri/ redirect');
+like(http_get('/alias-re-prefix/directory/'), qr!SEE THIS!,
+	'alias regex $uri/ index');
 
 }
 
-like(http_get('/alias-re-prefix/notfound'), qr!404 Not!, 'alias regex not found with prefix');
+like(http_get('/alias-re-prefix/notfound'), qr!404 Not!,
+	'alias regex not found with prefix');
 
 # various specific tests
 
diff --git a/lib/Test/Nginx.pm b/lib/Test/Nginx.pm
--- a/lib/Test/Nginx.pm
+++ b/lib/Test/Nginx.pm
@@ -829,7 +829,8 @@ sub log_core {
 	}
 
 	$msg =~ s/^/# $prefix/gm;
-	$msg =~ s/([^\x20-\x7e])/sprintf('\\x%02x', ord($1)) . (($1 eq "\n") ? "\n" : '')/gmxe;
+	$msg =~ s/([^\x20-\x7e])/sprintf('\\x%02x', ord($1))
+		. (($1 eq "\n") ? "\n" : '')/gmxe;
 	$msg .= "\n" unless $msg =~ /\n\Z/;
 	print $msg;
 }
diff --git a/mail_imap.t b/mail_imap.t
--- a/mail_imap.t
+++ b/mail_imap.t
@@ -123,10 +123,12 @@ my $s = Test::Nginx::IMAP->new();
 
 # auth plain
 
-$s->send('1 AUTHENTICATE PLAIN ' . encode_base64("\0test\@example.com\0bad", ''));
+$s->send('1 AUTHENTICATE PLAIN '
+	. encode_base64("\0test\@example.com\0bad", ''));
 $s->check(qr/^\S+ NO/, 'auth plain with bad password');
 
-$s->send('1 AUTHENTICATE PLAIN ' . encode_base64("\0test\@example.com\0secret", ''));
+$s->send('1 AUTHENTICATE PLAIN '
+	. encode_base64("\0test\@example.com\0secret", ''));
 $s->ok('auth plain');
 
 # auth login simple
diff --git a/proxy_xar.t b/proxy_xar.t
--- a/proxy_xar.t
+++ b/proxy_xar.t
@@ -83,7 +83,8 @@ my $r = http_get('/proxy?xar=/index.html
 like($r, qr/xar: \/index.html uri: \/index.html/, 'X-Accel-Redirect works');
 like($r, qr/^Content-Type: text\/blah/m, 'Content-Type preserved');
 like($r, qr/^Set-Cookie: blah=blah/m, 'Set-Cookie preserved');
-like($r, qr/^Content-Disposition: attachment/m, 'Content-Disposition preserved');
+like($r, qr/^Content-Disposition: attachment/m,
+	'Content-Disposition preserved');
 like($r, qr/^Cache-Control: no-cache/m, 'Cache-Control preserved');
 like($r, qr/^Expires: fake/m, 'Expires preserved');
 like($r, qr/^Accept-Ranges: parrots/m, 'Accept-Ranges preserved');
diff --git a/ssl.t b/ssl.t
--- a/ssl.t
+++ b/ssl.t
@@ -84,7 +84,8 @@ http {
             return 200 "body $ssl_client_s_dn:$ssl_client_s_dn_legacy";
         }
         location /time {
-            return 200 "body $ssl_client_v_start!$ssl_client_v_end!$ssl_client_v_remain";
+            return 200
+            "body $ssl_client_v_start!$ssl_client_v_end!$ssl_client_v_remain";
         }
 
         location /body {
diff --git a/stream_udp_limit_conn.t b/stream_udp_limit_conn.t
--- a/stream_udp_limit_conn.t
+++ b/stream_udp_limit_conn.t
@@ -97,7 +97,8 @@ is($s->io('1', read_timeout => 0.4), '1'
 is(dgram('127.0.0.1:' . port(8981))->io('1', read_timeout => 0.1), '',
 	'rejected new session');
 is(dgram('127.0.0.1:' . port(8982))->io('1'), '1', 'passed different zone');
-is(dgram('127.0.0.1:' . port(8983))->io('1'), '1', 'passed same zone unlimited');
+is(dgram('127.0.0.1:' . port(8983))->io('1'), '1',
+	'passed same zone unlimited');
 
 sleep 1;	# waiting for proxy_timeout to expire
 
diff --git a/sub_filter_perl.t b/sub_filter_perl.t
--- a/sub_filter_perl.t
+++ b/sub_filter_perl.t
@@ -96,11 +96,13 @@ like(http_get('/multi?a=a&b=aaaab'), qr/
 like(http_get('/multi?a=aa&b=ab'), qr/^a_replaced$/m, 'aab in aa + ab');
 like(http_get('/multi?a=aa&b=aab'), qr/^aa_replaced$/m, 'aab in aa + aab');
 like(http_get('/multi?a=aa&b=aaab'), qr/^aaa_replaced$/m, 'aab in aa + aaab');
-like(http_get('/multi?a=aa&b=aaaab'), qr/^aaaa_replaced$/m, 'aab in aa + aaaab');
+like(http_get('/multi?a=aa&b=aaaab'), qr/^aaaa_replaced$/m,
+	'aab in aa + aaaab');
 
 # full backtracking
 
-like(http_get('/multi?a=aa&b=xaaab'), qr/^aaxa_replaced$/m, 'aab in aa + xaaab');
+like(http_get('/multi?a=aa&b=xaaab'), qr/^aaxa_replaced$/m,
+	'aab in aa + xaaab');
 like(http_get('/multi?a=aa&b=axaaab'), qr/^aaaxa_replaced$/m,
 	'aab in aa + axaaab');
 like(http_get('/multi?a=aa&b=aaxaaab'), qr/^aaaaxa_replaced$/m,
@@ -118,6 +120,7 @@ like(http_get('/short?a=aa&b=b'), qr/^a_
 like(http_get('/short?a=aa&b=ab'), qr/^aa_replaced$/m, 'ab in aa + ab');
 like(http_get('/short?a=aa&b=aab'), qr/^aaa_replaced$/m, 'ab in aa + aab');
 like(http_get('/short?a=aa&b=aaab'), qr/^aaaa_replaced$/m, 'ab in aa + aaab');
-like(http_get('/short?a=aa&b=aaaab'), qr/^aaaaa_replaced$/m, 'ab in aa + aaaab');
+like(http_get('/short?a=aa&b=aaaab'), qr/^aaaaa_replaced$/m,
+	'ab in aa + aaaab');
 
 ###############################################################################


More information about the nginx-devel mailing list