summaryrefslogtreecommitdiff
path: root/dev-perl/Perl-Critic-Dynamic/files/Perl-Critic-Dynamic-0.05-test-cgi.patch
blob: 28b40ede53cc1d37992f62354dd519b76e087d3f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
From 42cd322ed7cc0b89692352ef5e78023bce71e865 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
Date: Thu, 9 Apr 2015 00:46:52 +1200
Subject: Fix AUTOLOAD test

CGI 4.14 stopped to use AUTOLOAD which caused failing tests. This patch
provides private module with AUTOLOAD instead of relying on CGI.

Bug: https://rt.cpan.org/Ticket/Display.html?id=103382
---
 t/Dynamic/ValidateAgainstSymbolTable.run | 11 ++++++-----
 tlib/TestAutoload.pm                     | 12 ++++++++++++
 2 files changed, 18 insertions(+), 5 deletions(-)
 create mode 100644 tlib/TestAutoload.pm

diff --git a/t/Dynamic/ValidateAgainstSymbolTable.run b/t/Dynamic/ValidateAgainstSymbolTable.run
index 493a9dd..5178922 100644
--- a/t/Dynamic/ValidateAgainstSymbolTable.run
+++ b/t/Dynamic/ValidateAgainstSymbolTable.run
@@ -336,23 +336,24 @@ use FooBar;
 #-----------------------------------------------------------------------------
 
 ## name AUTOLOADers ignored by default
+## parms { at_inc => 'tlib' }
 ## failures 0
 ## cut
 
-use CGI;  # Has 'sub AUTOLOAD {...}'
+use TestAutoload;  # Has 'sub AUTOLOAD {...}'
 
-CGI::FooBar();
+TestAutoload::FooBar();
 
 #-----------------------------------------------------------------------------
 
 ## name AUTOLOADers inspected on request
-## parms { inspect_autoloaders => 1 }
+## parms { at_inc => 'tlib', inspect_autoloaders => 1 }
 ## failures 1
 ## cut
 
-use CGI;  # Has 'sub AUTOLOAD {...}'
+use TestAutoload;  # Has 'sub AUTOLOAD {...}'
 
-CGI::FooBar();
+TestAutoload::FooBar();
 
 
 #-----------------------------------------------------------------------------
diff --git a/tlib/TestAutoload.pm b/tlib/TestAutoload.pm
new file mode 100644
index 0000000..939f563
--- /dev/null
+++ b/tlib/TestAutoload.pm
@@ -0,0 +1,12 @@
+package TestAutoload;
+
+sub AUTOLOAD {
+    print "Autoloading <$AUTOLOAD>\n";
+    goto &foo;
+}   
+
+sub foo {
+    print "foo() called\n";
+}   
+
+1;
-- 
2.15.1