diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-25 04:41:28 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-25 04:41:28 +0000 |
commit | 2eeb62e38ae17a3523ad3cd81c3de9f20f9e7742 (patch) | |
tree | fe91033d4712f6d836006b998525656b9dd193b8 /debian/perl-framework/t/modules/substitute.t | |
parent | Merging upstream version 2.4.59. (diff) | |
download | apache2-debian.tar.xz apache2-debian.zip |
Adding debian version 2.4.59-1~deb10u1.debian/2.4.59-1_deb10u1debian
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'debian/perl-framework/t/modules/substitute.t')
-rw-r--r-- | debian/perl-framework/t/modules/substitute.t | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/debian/perl-framework/t/modules/substitute.t b/debian/perl-framework/t/modules/substitute.t index cc8c153..0f111c0 100644 --- a/debian/perl-framework/t/modules/substitute.t +++ b/debian/perl-framework/t/modules/substitute.t @@ -15,6 +15,8 @@ my $B = chr(0x02); my $F = chr(0x06); my $P = chr(0x10); +my @simple_cases = (); + my @test_cases = ( [ "f${B}o${P}ofoo" => 's/foo/bar/' ], [ "f${B}o${P}ofoo" => 's/fo/fa/', 's/fao/bar/' ], @@ -40,7 +42,10 @@ if (have_min_apache_version("2.3.5")) { [ "foobar" => 's/(oo)b/\d$1/' ]; } -plan tests => scalar @test_cases, +if (have_min_apache_version("2.4.42")) { + push @simple_cases, [ "foo\nbar" => 's/foo.*/XXX$0XXX', "XXXfooXXX\nbar" ], +} +plan tests => scalar @test_cases + scalar @simple_cases, need need_lwp, need_module('mod_substitute'), need_module('mod_bucketeer'); @@ -84,6 +89,18 @@ foreach my $t (@test_cases) { ok($ok); } +foreach my $t (@simple_cases) { + my ($content, $rule, $expect) = @{$t}; + write_testfile($content); + write_htaccess($rule); + my $response = GET('/modules/substitute/test.txt'); + my $rc = $response->code; + my $got = $response->content; + my $ok = ($rc == 200) && ($got eq $expect); + print "got $rc '$got'", ($ok ? ": OK\n" : ", expected '$expect'\n"); + + ok($ok); +} exit 0; ### sub routines |