Mercurial > hg > nginx-tests
diff h2_server_tokens.t @ 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 | 766bcbb632ee |
children | 236d038dc04a |
line wrap: on
line diff
--- a/h2_server_tokens.t +++ b/h2_server_tokens.t @@ -106,7 +106,7 @@ like(header_server('/on/200'), qr/^$re$/ 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');