Commit | Line | Data |
599cee73 |
1 | Check anti-lint |
2 | |
3 | __END__ |
4 | -X |
5 | # nolint: check compile time $^W is zapped |
6 | BEGIN { $^W = 1 ;} |
7 | $a = $b = 1 ; |
8 | $a = 1 if $a EQ $b ; |
9 | close STDIN ; print STDIN "abc" ; |
10 | EXPECT |
11 | ######## |
12 | -X |
13 | # nolint: check runtime $^W is zapped |
14 | $^W = 1 ; |
15 | close STDIN ; print STDIN "abc" ; |
16 | EXPECT |
17 | ######## |
18 | -X |
19 | # nolint: check runtime $^W is zapped |
20 | { |
21 | $^W = 1 ; |
22 | close STDIN ; print STDIN "abc" ; |
23 | } |
24 | EXPECT |
25 | ######## |
26 | -X |
4438c4b7 |
27 | # nolint: check "no warnings" is zapped |
28 | use warnings ; |
599cee73 |
29 | $a = $b = 1 ; |
30 | $a = 1 if $a EQ $b ; |
31 | close STDIN ; print STDIN "abc" ; |
32 | EXPECT |
33 | ######## |
34 | -X |
4438c4b7 |
35 | # nolint: check "no warnings" is zapped |
599cee73 |
36 | { |
4438c4b7 |
37 | use warnings ; |
599cee73 |
38 | close STDIN ; print STDIN "abc" ; |
39 | } |
40 | EXPECT |
41 | ######## |
42 | -Xw |
43 | # nolint: check combination of -w and -X |
44 | { |
45 | $^W = 1 ; |
46 | close STDIN ; print STDIN "abc" ; |
47 | } |
48 | EXPECT |
49 | ######## |
50 | -X |
51 | --FILE-- abc.pm |
4438c4b7 |
52 | use warnings 'deprecated' ; |
599cee73 |
53 | my ($a, $b) = (0,0); |
54 | 1 if $a EQ $b ; |
55 | 1; |
56 | --FILE-- |
4438c4b7 |
57 | use warnings 'uninitialized' ; |
599cee73 |
58 | use abc; |
59 | my $a ; chop $a ; |
60 | EXPECT |
61 | ######## |
62 | -X |
63 | --FILE-- abc |
4438c4b7 |
64 | use warnings 'deprecated' ; |
599cee73 |
65 | my ($a, $b) = (0,0); |
66 | 1 if $a EQ $b ; |
67 | 1; |
68 | --FILE-- |
4438c4b7 |
69 | use warnings 'uninitialized' ; |
599cee73 |
70 | require "./abc"; |
71 | my $a ; chop $a ; |
72 | EXPECT |
73 | ######## |
74 | -X |
75 | --FILE-- abc.pm |
76 | BEGIN {$^W = 1} |
77 | my ($a, $b) = (0,0); |
78 | 1 if $a EQ $b ; |
79 | 1; |
80 | --FILE-- |
81 | $^W = 1 ; |
82 | use abc; |
83 | my $a ; chop $a ; |
84 | EXPECT |
85 | ######## |
86 | -X |
87 | --FILE-- abc |
88 | BEGIN {$^W = 1} |
89 | my ($a, $b) = (0,0); |
90 | 1 if $a EQ $b ; |
91 | 1; |
92 | --FILE-- |
93 | $^W = 1 ; |
94 | require "./abc"; |
95 | my $a ; chop $a ; |
96 | EXPECT |
92d29cee |
97 | ######## |
98 | -X |
99 | # Check scope of pragma with eval |
100 | use warnings; |
101 | { |
102 | no warnings ; |
103 | eval ' |
104 | my $b ; chop $b ; |
105 | '; print STDERR $@ ; |
106 | my $b ; chop $b ; |
107 | } |
108 | EXPECT |
109 | |
110 | ######## |
111 | -X |
112 | # Check scope of pragma with eval |
113 | use warnings; |
114 | { |
115 | no warnings ; |
116 | eval q[ |
117 | use warnings 'uninitialized' ; |
118 | my $b ; chop $b ; |
119 | ]; print STDERR $@; |
120 | my $b ; chop $b ; |
121 | } |
122 | EXPECT |
123 | |
124 | ######## |
125 | -X |
126 | # Check scope of pragma with eval |
127 | no warnings; |
128 | { |
129 | use warnings 'uninitialized' ; |
130 | eval ' |
131 | my $b ; chop $b ; |
132 | '; print STDERR $@ ; |
133 | my $b ; chop $b ; |
134 | } |
135 | EXPECT |
136 | |
137 | ######## |
138 | -X |
139 | # Check scope of pragma with eval |
140 | no warnings; |
141 | { |
142 | use warnings 'uninitialized' ; |
143 | eval ' |
144 | no warnings ; |
145 | my $b ; chop $b ; |
146 | '; print STDERR $@ ; |
147 | my $b ; chop $b ; |
148 | } |
149 | EXPECT |
150 | |
151 | ######## |
152 | -X |
153 | # Check scope of pragma with eval |
154 | use warnings; |
155 | { |
156 | no warnings ; |
157 | eval ' |
158 | 1 if $a EQ $b ; |
159 | '; print STDERR $@ ; |
160 | 1 if $a EQ $b ; |
161 | } |
162 | EXPECT |
163 | |
164 | ######## |
165 | -X |
166 | # Check scope of pragma with eval |
167 | use warnings; |
168 | { |
169 | no warnings ; |
170 | eval q[ |
171 | use warnings 'deprecated' ; |
172 | 1 if $a EQ $b ; |
173 | ]; print STDERR $@; |
174 | 1 if $a EQ $b ; |
175 | } |
176 | EXPECT |
177 | |
178 | ######## |
179 | -X |
180 | # Check scope of pragma with eval |
181 | no warnings; |
182 | { |
183 | use warnings 'deprecated' ; |
184 | eval ' |
185 | 1 if $a EQ $b ; |
186 | '; print STDERR $@; |
187 | 1 if $a EQ $b ; |
188 | } |
189 | EXPECT |
190 | |
191 | ######## |
192 | -X |
193 | # Check scope of pragma with eval |
194 | no warnings; |
195 | { |
196 | use warnings 'deprecated' ; |
197 | eval ' |
198 | no warnings ; |
199 | 1 if $a EQ $b ; |
200 | '; print STDERR $@; |
201 | 1 if $a EQ $b ; |
202 | } |
203 | EXPECT |
204 | |