Mercurial > hg > nginx-tests
changeset 1859:5f46af4707e7
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.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Thu, 18 May 2023 18:07:04 +0300 |
parents | cdcd75657e52 |
children | 58951cf933e1 |
files | h2_server_tokens.t server_tokens.t |
diffstat | 2 files changed, 2 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/h2_server_tokens.t Thu May 18 18:07:02 2023 +0300 +++ b/h2_server_tokens.t Thu May 18 18:07:04 2023 +0300 @@ -106,7 +106,7 @@ like(header_server('/on/404'), qr/^$re$/, 'http2 tokens on 404'); like(body('/on/404'), $re, 'http2 tokens on 404 body'); -$re = qr/$re \Q($1)\E/ if $t->{_configure_args} =~ /--build=(\S+)/; +$re = qr/$re \(.*\)/ if $t->has_module('--build='); like(header_server('/b/200'), qr/^$re$/, 'http2 tokens build 200'); like(header_server('/b/404'), qr/^$re$/, 'http2 tokens build 404');
--- a/server_tokens.t Thu May 18 18:07:02 2023 +0300 +++ b/server_tokens.t Thu May 18 18:07:04 2023 +0300 @@ -105,7 +105,7 @@ like(http_get_server('/on/404'), $re, 'tokens on 404'); like(http_body('/on/404'), $re, 'tokens on 404 body'); -$re = qr/$re \Q($1)\E/ if $t->{_configure_args} =~ /--build=(\S+)/; +$re = qr/$re \(.*\)/ if $t->has_module('--build='); like(http_get_server('/b/200'), $re, 'tokens build 200'); like(http_get_server('/b/404'), $re, 'tokens build 404');