autoquote barewords followed by newline and arrow properly
[p5sagit/p5-mst-13.2.git] / t / pragma / warn / 5nolint
CommitLineData
599cee73 1Check anti-lint
2
3__END__
4-X
5# nolint: check compile time $^W is zapped
6BEGIN { $^W = 1 ;}
7$a = $b = 1 ;
8$a = 1 if $a EQ $b ;
9close STDIN ; print STDIN "abc" ;
10EXPECT
11########
12-X
13# nolint: check runtime $^W is zapped
14$^W = 1 ;
15close STDIN ; print STDIN "abc" ;
16EXPECT
17########
18-X
19# nolint: check runtime $^W is zapped
20{
21 $^W = 1 ;
22 close STDIN ; print STDIN "abc" ;
23}
24EXPECT
25########
26-X
4438c4b7 27# nolint: check "no warnings" is zapped
28use warnings ;
599cee73 29$a = $b = 1 ;
30$a = 1 if $a EQ $b ;
31close STDIN ; print STDIN "abc" ;
32EXPECT
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}
40EXPECT
41########
42-Xw
43# nolint: check combination of -w and -X
44{
45 $^W = 1 ;
46 close STDIN ; print STDIN "abc" ;
47}
48EXPECT
49########
50-X
51--FILE-- abc.pm
4438c4b7 52use warnings 'deprecated' ;
599cee73 53my ($a, $b) = (0,0);
541 if $a EQ $b ;
551;
56--FILE--
4438c4b7 57use warnings 'uninitialized' ;
599cee73 58use abc;
59my $a ; chop $a ;
60EXPECT
61########
62-X
63--FILE-- abc
4438c4b7 64use warnings 'deprecated' ;
599cee73 65my ($a, $b) = (0,0);
661 if $a EQ $b ;
671;
68--FILE--
4438c4b7 69use warnings 'uninitialized' ;
599cee73 70require "./abc";
71my $a ; chop $a ;
72EXPECT
73########
74-X
75--FILE-- abc.pm
76BEGIN {$^W = 1}
77my ($a, $b) = (0,0);
781 if $a EQ $b ;
791;
80--FILE--
81$^W = 1 ;
82use abc;
83my $a ; chop $a ;
84EXPECT
85########
86-X
87--FILE-- abc
88BEGIN {$^W = 1}
89my ($a, $b) = (0,0);
901 if $a EQ $b ;
911;
92--FILE--
93$^W = 1 ;
94require "./abc";
95my $a ; chop $a ;
96EXPECT
16ff4256 97########
98-X
99# Check scope of pragma with eval
100use warnings;
101{
102 no warnings ;
103 eval '
104 my $b ; chop $b ;
105 '; print STDERR $@ ;
106 my $b ; chop $b ;
107}
108EXPECT
109
110########
111-X
112# Check scope of pragma with eval
113use 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}
122EXPECT
123
124########
125-X
126# Check scope of pragma with eval
127no warnings;
128{
129 use warnings 'uninitialized' ;
130 eval '
131 my $b ; chop $b ;
132 '; print STDERR $@ ;
133 my $b ; chop $b ;
134}
135EXPECT
136
137########
138-X
139# Check scope of pragma with eval
140no 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}
149EXPECT
150
151########
152-X
153# Check scope of pragma with eval
154use warnings;
155{
156 no warnings ;
157 eval '
158 1 if $a EQ $b ;
159 '; print STDERR $@ ;
160 1 if $a EQ $b ;
161}
162EXPECT
163
164########
165-X
166# Check scope of pragma with eval
167use 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}
176EXPECT
177
178########
179-X
180# Check scope of pragma with eval
181no warnings;
182{
183 use warnings 'deprecated' ;
184 eval '
185 1 if $a EQ $b ;
186 '; print STDERR $@;
187 1 if $a EQ $b ;
188}
189EXPECT
190
191########
192-X
193# Check scope of pragma with eval
194no 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}
203EXPECT
204