Mercurial > hg > nginx-tests
comparison 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 | e0b55129fbbf |
comparison
equal
deleted
inserted
replaced
1858:cdcd75657e52 | 1859:5f46af4707e7 |
---|---|
103 | 103 |
104 like(http_get_server('/on/200'), $re, 'tokens on 200'); | 104 like(http_get_server('/on/200'), $re, 'tokens on 200'); |
105 like(http_get_server('/on/404'), $re, 'tokens on 404'); | 105 like(http_get_server('/on/404'), $re, 'tokens on 404'); |
106 like(http_body('/on/404'), $re, 'tokens on 404 body'); | 106 like(http_body('/on/404'), $re, 'tokens on 404 body'); |
107 | 107 |
108 $re = qr/$re \Q($1)\E/ if $t->{_configure_args} =~ /--build=(\S+)/; | 108 $re = qr/$re \(.*\)/ if $t->has_module('--build='); |
109 | 109 |
110 like(http_get_server('/b/200'), $re, 'tokens build 200'); | 110 like(http_get_server('/b/200'), $re, 'tokens build 200'); |
111 like(http_get_server('/b/404'), $re, 'tokens build 404'); | 111 like(http_get_server('/b/404'), $re, 'tokens build 404'); |
112 like(http_body('/b/404'), $re, 'tokens build 404 body'); | 112 like(http_body('/b/404'), $re, 'tokens build 404 body'); |
113 | 113 |