Skip to content
Snippets Groups Projects
Commit 804f010e authored by gregor herrmann's avatar gregor herrmann
Browse files

Add patch from upstream PR to fix test failure with newer CGI.pm.

Closes: #1054774
parent 27bbc999
No related branches found
No related tags found
No related merge requests found
From cfd975164fb2846edb8ee96538362398ecab5903 Mon Sep 17 00:00:00 2001
From: Dietrich Streifert <dietrich.streifert@googlemail.com>
Date: Thu, 26 Oct 2023 10:38:35 +0200
Subject: [PATCH] Update 06_expiry.t to accept old and new cookie data format
(RT #149959)
Bug-Debian: https://bugs.debian.org/1054774
Bug: https://rt.cpan.org/Public/Bug/Display.html?id=149959
Origin: https://github.com/frioux/CGI-Application-Plugin-Session/pull/1
---
t/06_expiry.t | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/t/06_expiry.t b/t/06_expiry.t
index bff7db7..dc01e35 100644
--- a/t/06_expiry.t
+++ b/t/06_expiry.t
@@ -19,7 +19,7 @@ my $t1_output = $t1_obj->run();
like($t1_output, qr/\(3600\)/, 'expiry set correctly');
like($t1_output, qr/Set-Cookie: CGISESSID=[a-zA-Z0-9]+/, 'session cookie set');
like($t1_output, qr/expires=\w{3}, /, 'session cookie expiry set');
-my ($year) = $t1_output =~ /\d+\-\w{3}\-(\d+) /s;
+my ($year) = $t1_output =~ /\d+[ \-]\w{3}[ \-](\d+) /s;
my ($id1) = $t1_output =~ /CGISESSID=([a-zA-Z0-9]+)/s;
ok($id1, 'found session id');
@@ -38,7 +38,7 @@ $t1_output = $t1_obj->run();
like($t1_output, qr/\(3600\)/, 'expiry set correctly');
like($t1_output, qr/Set-Cookie: CGISESSID=[a-zA-Z0-9]+/, 'session cookie set');
like($t1_output, qr/expires=\w{3}, /, 'session cookie expiry set');
-my ($year2) = $t1_output =~ /\d+\-\w{3}\-(\d+) /s;
+my ($year2) = $t1_output =~ /\d+[ \-]\w{3}[ \-](\d+) /s;
# This test will fail during the last hour of the year, but I can't be bother to
# test for that :)
@@ -62,7 +62,7 @@ $t1_output = $t1_obj->run();
like($t1_output, qr/\(\-31536000\)/, 'expiry set correctly');
like($t1_output, qr/Set-Cookie: CGISESSID=[a-zA-Z0-9]+/, 'session cookie set');
like($t1_output, qr/expires=\w{3}, /, 'session cookie expiry set');
-($year2) = $t1_output =~ /\d+\-\w{3}\-(\d+) /s;
+($year2) = $t1_output =~ /\d+[ \-]\w{3}[ \-](\d+) /s;
# This test will fail during the last hour of the year, but I can't be bother to
# test for that :)
RT149959.patch
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment