Skip to content

Commit a9c5731

Browse files
committed
Tests: fixed server_tokens tests for build names with spaces.
Build names can contain spaces, and previously used pattern, "--build=(\S+)", failed to properly match such build names. Instead, now we simply test that some build name is provided in the Server header and error pages. Further, the $t->has_module() method is now used to check if a build name is set instead of directly testing the $t->{_configure_args} internal field.
1 parent 7ef3ddc commit a9c5731

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

h2_server_tokens.t

+1-1
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ like(header_server('/on/200'), qr/^$re$/, 'http2 tokens on 200');
106106
like(header_server('/on/404'), qr/^$re$/, 'http2 tokens on 404');
107107
like(body('/on/404'), $re, 'http2 tokens on 404 body');
108108

109-
$re = qr/$re \Q($1)\E/ if $t->{_configure_args} =~ /--build=(\S+)/;
109+
$re = qr/$re \(.*\)/ if $t->has_module('--build=');
110110

111111
like(header_server('/b/200'), qr/^$re$/, 'http2 tokens build 200');
112112
like(header_server('/b/404'), qr/^$re$/, 'http2 tokens build 404');

server_tokens.t

+1-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ like(http_get_server('/on/200'), $re, 'tokens on 200');
105105
like(http_get_server('/on/404'), $re, 'tokens on 404');
106106
like(http_body('/on/404'), $re, 'tokens on 404 body');
107107

108-
$re = qr/$re \Q($1)\E/ if $t->{_configure_args} =~ /--build=(\S+)/;
108+
$re = qr/$re \(.*\)/ if $t->has_module('--build=');
109109

110110
like(http_get_server('/b/200'), $re, 'tokens build 200');
111111
like(http_get_server('/b/404'), $re, 'tokens build 404');

0 commit comments

Comments
 (0)