Rename warning to warnings, from Paul Marquess.
[p5sagit/p5-mst-13.2.git] / t / pragma / warn / 4lint
1 Check lint
2
3 __END__
4 -W
5 # lint: check compile time $^W is zapped
6 BEGIN { $^W = 0 ;}
7 $a = $b = 1 ;
8 $a = 1 if $a EQ $b ;
9 close STDIN ; print STDIN "abc" ;
10 EXPECT
11 Use of EQ is deprecated at - line 5.
12 print on closed filehandle main::STDIN at - line 6.
13 ########
14 -W
15 # lint: check runtime $^W is zapped
16 $^W = 0 ;
17 close STDIN ; print STDIN "abc" ;
18 EXPECT
19 print on closed filehandle main::STDIN at - line 4.
20 ########
21 -W
22 # lint: check runtime $^W is zapped
23 {
24   $^W = 0 ;
25   close STDIN ; print STDIN "abc" ;
26 }
27 EXPECT
28 print on closed filehandle main::STDIN at - line 5.
29 ########
30 -W
31 # lint: check "no warnings" is zapped
32 no warnings ;
33 $a = $b = 1 ;
34 $a = 1 if $a EQ $b ;
35 close STDIN ; print STDIN "abc" ;
36 EXPECT
37 Use of EQ is deprecated at - line 5.
38 print on closed filehandle main::STDIN at - line 6.
39 ########
40 -W
41 # lint: check "no warnings" is zapped
42 {
43   no warnings ;
44   close STDIN ; print STDIN "abc" ;
45 }
46 EXPECT
47 print on closed filehandle main::STDIN at - line 5.
48 ########
49 -Ww
50 # lint: check combination of -w and -W
51 {
52   $^W = 0 ;
53   close STDIN ; print STDIN "abc" ;
54 }
55 EXPECT
56 print on closed filehandle main::STDIN at - line 5.
57 ########
58 -W
59 --FILE-- abc.pm
60 no warnings 'deprecated' ;
61 my ($a, $b) = (0,0);
62 1 if $a EQ $b ;
63 1;
64 --FILE-- 
65 no warnings 'uninitialized' ;
66 use abc;
67 my $a ; chop $a ;
68 EXPECT
69 Use of EQ is deprecated at abc.pm line 3.
70 Use of uninitialized value at - line 3.
71 ########
72 -W
73 --FILE-- abc
74 no warnings 'deprecated' ;
75 my ($a, $b) = (0,0);
76 1 if $a EQ $b ;
77 1;
78 --FILE-- 
79 no warnings 'uninitialized' ;
80 require "./abc";
81 my $a ; chop $a ;
82 EXPECT
83 Use of EQ is deprecated at ./abc line 3.
84 Use of uninitialized value at - line 3.
85 ########
86 -W
87 --FILE-- abc.pm
88 BEGIN {$^W = 0}
89 my ($a, $b) = (0,0);
90 1 if $a EQ $b ;
91 1;
92 --FILE-- 
93 $^W = 0 ;
94 use abc;
95 my $a ; chop $a ;
96 EXPECT
97 Use of EQ is deprecated at abc.pm line 3.
98 Use of uninitialized value at - line 3.
99 ########
100 -W
101 --FILE-- abc
102 BEGIN {$^W = 0}
103 my ($a, $b) = (0,0);
104 1 if $a EQ $b ;
105 1;
106 --FILE-- 
107 $^W = 0 ;
108 require "./abc";
109 my $a ; chop $a ;
110 EXPECT
111 Use of EQ is deprecated at ./abc line 3.
112 Use of uninitialized value at - line 3.