[PATCH] Tests: fixed prerequisites for regular expressions in maps

Maxim Dounin mdounin at mdounin.ru
Thu Aug 1 07:37:49 UTC 2024


# HG changeset patch
# User Maxim Dounin <mdounin at mdounin.ru>
# Date 1722497840 -10800
#      Thu Aug 01 10:37:20 2024 +0300
# Node ID 6b1222de82860405a1563d7f3cdb79765a53ec09
# Parent  d715aff0b61d4c3f48f6de84cd06aa7847e1f711
Tests: fixed prerequisites for regular expressions in maps.

Regular expressions in maps are only recognized when nginx is compiled
with the PCRE library.  The simplest way to make sure it is the case
is to require the rewrite module, which cannot be compiled in without
the PCRE library.

diff --git a/proxy_protocol2_tlv.t b/proxy_protocol2_tlv.t
--- a/proxy_protocol2_tlv.t
+++ b/proxy_protocol2_tlv.t
@@ -23,7 +23,7 @@ use Test::Nginx;
 select STDERR; $| = 1;
 select STDOUT; $| = 1;
 
-my $t = Test::Nginx->new()->has(qw/http map/)->plan(14)
+my $t = Test::Nginx->new()->has(qw/http map rewrite/)->plan(14)
 	->write_file_expand('nginx.conf', <<'EOF');
 
 %%TEST_GLOBALS%%
diff --git a/stream_map.t b/stream_map.t
--- a/stream_map.t
+++ b/stream_map.t
@@ -23,7 +23,7 @@ use Test::Nginx::Stream qw/ stream /;
 select STDERR; $| = 1;
 select STDOUT; $| = 1;
 
-my $t = Test::Nginx->new()->has(qw/stream stream_return stream_map/)
+my $t = Test::Nginx->new()->has(qw/stream stream_return stream_map rewrite/)
 	->has(qw/http rewrite/);
 
 $t->write_file_expand('nginx.conf', <<'EOF');
diff --git a/stream_proxy_protocol2_tlv.t b/stream_proxy_protocol2_tlv.t
--- a/stream_proxy_protocol2_tlv.t
+++ b/stream_proxy_protocol2_tlv.t
@@ -24,7 +24,8 @@ use Test::Nginx::Stream qw/ stream /;
 select STDERR; $| = 1;
 select STDOUT; $| = 1;
 
-my $t = Test::Nginx->new()->has(qw/stream stream_return map/)->plan(14)
+my $t = Test::Nginx->new()
+	->has(qw/stream stream_return stream_map rewrite/)->plan(14)
 	->write_file_expand('nginx.conf', <<'EOF');
 
 %%TEST_GLOBALS%%



More information about the nginx-devel mailing list