Commit | Line | Data |
4438c4b7 |
1 | Check FATAL functionality |
2 | |
3 | __END__ |
4 | |
5 | # Check compile time warning |
6 | use warnings FATAL => 'deprecated' ; |
7 | { |
8 | no warnings ; |
9 | 1 if $a EQ $b ; |
10 | } |
11 | 1 if $a EQ $b ; |
12 | print STDERR "The End.\n" ; |
13 | EXPECT |
14 | Use of EQ is deprecated at - line 8. |
15 | ######## |
16 | |
17 | # Check runtime scope of pragma |
18 | use warnings FATAL => 'uninitialized' ; |
19 | { |
20 | no warnings ; |
21 | my $b ; chop $b ; |
22 | } |
23 | my $b ; chop $b ; |
24 | print STDERR "The End.\n" ; |
25 | EXPECT |
b89fed5f |
26 | Use of uninitialized value in scalar chop at - line 8. |
4438c4b7 |
27 | ######## |
28 | |
29 | # Check runtime scope of pragma |
30 | no warnings ; |
31 | { |
32 | use warnings FATAL => 'uninitialized' ; |
33 | $a = sub { my $b ; chop $b ; } |
34 | } |
35 | &$a ; |
36 | print STDERR "The End.\n" ; |
37 | EXPECT |
b89fed5f |
38 | Use of uninitialized value in scalar chop at - line 6. |
4438c4b7 |
39 | ######## |
40 | |
41 | --FILE-- abc |
42 | 1 if $a EQ $b ; |
43 | 1; |
44 | --FILE-- |
45 | use warnings FATAL => 'deprecated' ; |
46 | require "./abc"; |
47 | EXPECT |
48 | |
49 | ######## |
50 | |
51 | --FILE-- abc |
52 | use warnings FATAL => 'deprecated' ; |
53 | 1; |
54 | --FILE-- |
55 | require "./abc"; |
56 | 1 if $a EQ $b ; |
57 | EXPECT |
58 | |
59 | ######## |
60 | |
61 | --FILE-- abc |
62 | use warnings 'deprecated' ; |
63 | 1 if $a EQ $b ; |
64 | 1; |
65 | --FILE-- |
66 | use warnings FATAL => 'uninitialized' ; |
67 | require "./abc"; |
68 | my $a ; chop $a ; |
69 | print STDERR "The End.\n" ; |
70 | EXPECT |
71 | Use of EQ is deprecated at ./abc line 2. |
b89fed5f |
72 | Use of uninitialized value in scalar chop at - line 3. |
4438c4b7 |
73 | ######## |
74 | |
75 | --FILE-- abc.pm |
76 | use warnings 'deprecated' ; |
77 | 1 if $a EQ $b ; |
78 | 1; |
79 | --FILE-- |
80 | use warnings FATAL => 'uninitialized' ; |
81 | use abc; |
82 | my $a ; chop $a ; |
83 | print STDERR "The End.\n" ; |
84 | EXPECT |
85 | Use of EQ is deprecated at abc.pm line 2. |
b89fed5f |
86 | Use of uninitialized value in scalar chop at - line 3. |
4438c4b7 |
87 | ######## |
88 | |
89 | # Check scope of pragma with eval |
90 | no warnings ; |
91 | eval { |
92 | use warnings FATAL => 'uninitialized' ; |
93 | my $b ; chop $b ; |
94 | }; print STDERR "-- $@" ; |
95 | my $b ; chop $b ; |
96 | print STDERR "The End.\n" ; |
97 | EXPECT |
b89fed5f |
98 | -- Use of uninitialized value in scalar chop at - line 6. |
4438c4b7 |
99 | The End. |
100 | ######## |
101 | |
102 | # Check scope of pragma with eval |
103 | use warnings FATAL => 'uninitialized' ; |
104 | eval { |
105 | my $b ; chop $b ; |
106 | }; print STDERR "-- $@" ; |
107 | my $b ; chop $b ; |
108 | print STDERR "The End.\n" ; |
109 | EXPECT |
b89fed5f |
110 | -- Use of uninitialized value in scalar chop at - line 5. |
111 | Use of uninitialized value in scalar chop at - line 7. |
4438c4b7 |
112 | ######## |
113 | |
114 | # Check scope of pragma with eval |
115 | use warnings FATAL => 'uninitialized' ; |
116 | eval { |
117 | no warnings ; |
118 | my $b ; chop $b ; |
119 | }; print STDERR $@ ; |
120 | my $b ; chop $b ; |
121 | print STDERR "The End.\n" ; |
122 | EXPECT |
b89fed5f |
123 | Use of uninitialized value in scalar chop at - line 8. |
4438c4b7 |
124 | ######## |
125 | |
126 | # Check scope of pragma with eval |
127 | no warnings ; |
128 | eval { |
129 | use warnings FATAL => 'deprecated' ; |
130 | 1 if $a EQ $b ; |
131 | }; print STDERR "-- $@" ; |
132 | 1 if $a EQ $b ; |
133 | print STDERR "The End.\n" ; |
134 | EXPECT |
135 | Use of EQ is deprecated at - line 6. |
136 | ######## |
137 | |
138 | # Check scope of pragma with eval |
139 | use warnings FATAL => 'deprecated' ; |
140 | eval { |
141 | 1 if $a EQ $b ; |
142 | }; print STDERR "-- $@" ; |
143 | 1 if $a EQ $b ; |
144 | print STDERR "The End.\n" ; |
145 | EXPECT |
146 | Use of EQ is deprecated at - line 5. |
147 | ######## |
148 | |
149 | # Check scope of pragma with eval |
150 | use warnings FATAL => 'deprecated' ; |
151 | eval { |
152 | no warnings ; |
153 | 1 if $a EQ $b ; |
154 | }; print STDERR $@ ; |
155 | 1 if $a EQ $b ; |
156 | print STDERR "The End.\n" ; |
157 | EXPECT |
158 | Use of EQ is deprecated at - line 8. |
159 | ######## |
160 | |
161 | # Check scope of pragma with eval |
162 | no warnings ; |
163 | eval { |
164 | use warnings FATAL => 'deprecated' ; |
165 | }; print STDERR $@ ; |
166 | 1 if $a EQ $b ; |
167 | print STDERR "The End.\n" ; |
168 | EXPECT |
169 | The End. |
170 | ######## |
171 | |
172 | # Check scope of pragma with eval |
173 | no warnings ; |
174 | eval q[ |
175 | use warnings FATAL => 'uninitialized' ; |
176 | my $b ; chop $b ; |
177 | ]; print STDERR "-- $@"; |
178 | my $b ; chop $b ; |
179 | print STDERR "The End.\n" ; |
180 | EXPECT |
b89fed5f |
181 | -- Use of uninitialized value in scalar chop at (eval 1) line 3. |
4438c4b7 |
182 | The End. |
183 | ######## |
184 | |
185 | # Check scope of pragma with eval |
186 | use warnings FATAL => 'uninitialized' ; |
187 | eval ' |
188 | my $b ; chop $b ; |
189 | '; print STDERR "-- $@" ; |
190 | my $b ; chop $b ; |
191 | print STDERR "The End.\n" ; |
192 | EXPECT |
b89fed5f |
193 | -- Use of uninitialized value in scalar chop at (eval 1) line 2. |
194 | Use of uninitialized value in scalar chop at - line 7. |
4438c4b7 |
195 | ######## |
196 | |
197 | # Check scope of pragma with eval |
198 | use warnings FATAL => 'uninitialized' ; |
199 | eval ' |
200 | no warnings ; |
201 | my $b ; chop $b ; |
202 | '; print STDERR $@ ; |
203 | my $b ; chop $b ; |
204 | print STDERR "The End.\n" ; |
205 | EXPECT |
b89fed5f |
206 | Use of uninitialized value in scalar chop at - line 8. |
4438c4b7 |
207 | ######## |
208 | |
209 | # Check scope of pragma with eval |
210 | no warnings ; |
211 | eval q[ |
212 | use warnings FATAL => 'deprecated' ; |
213 | 1 if $a EQ $b ; |
214 | ]; print STDERR "-- $@"; |
215 | 1 if $a EQ $b ; |
216 | print STDERR "The End.\n" ; |
217 | EXPECT |
218 | -- Use of EQ is deprecated at (eval 1) line 3. |
219 | The End. |
220 | ######## |
221 | |
222 | # Check scope of pragma with eval |
223 | use warnings FATAL => 'deprecated' ; |
224 | eval ' |
225 | 1 if $a EQ $b ; |
226 | '; print STDERR "-- $@"; |
227 | print STDERR "The End.\n" ; |
228 | EXPECT |
229 | -- Use of EQ is deprecated at (eval 1) line 2. |
230 | The End. |
231 | ######## |
232 | |
233 | # Check scope of pragma with eval |
234 | use warnings FATAL => 'deprecated' ; |
235 | eval ' |
236 | no warnings ; |
237 | 1 if $a EQ $b ; |
238 | '; print STDERR "-- $@"; |
239 | 1 if $a EQ $b ; |
240 | print STDERR "The End.\n" ; |
241 | EXPECT |
242 | Use of EQ is deprecated at - line 8. |