Commit | Line | Data |
0453d815 |
1 | Check default warnings |
2 | |
3 | __END__ |
4438c4b7 |
4 | # default warnings should be displayed if you don't add anything |
0453d815 |
5 | # optional shouldn't |
6 | my $a = oct "7777777777777777777777777777777777779" ; |
7 | EXPECT |
8 | Integer overflow in octal number at - line 3. |
9 | ######## |
4438c4b7 |
10 | # no warnings should be displayed |
11 | no warnings ; |
9e24b6e2 |
12 | my $a = oct "7777777777777777777777777777777777778" ; |
0453d815 |
13 | EXPECT |
14 | ######## |
4438c4b7 |
15 | # all warnings should be displayed |
16 | use warnings ; |
9e24b6e2 |
17 | my $a = oct "7777777777777777777777777777777777778" ; |
0453d815 |
18 | EXPECT |
9e24b6e2 |
19 | Integer overflow in octal number at - line 3. |
20 | Illegal octal digit '8' ignored at - line 3. |
21 | Octal number > 037777777777 non-portable at - line 3. |
0453d815 |
22 | ######## |
23 | # check scope |
4438c4b7 |
24 | use warnings ; |
9e24b6e2 |
25 | my $a = oct "7777777777777777777777777777777777778" ; |
0453d815 |
26 | { |
4438c4b7 |
27 | no warnings ; |
9e24b6e2 |
28 | my $a = oct "7777777777777777777777777777777777778" ; |
0453d815 |
29 | } |
9e24b6e2 |
30 | my $c = oct "7777777777777777777777777777777777778" ; |
0453d815 |
31 | EXPECT |
9e24b6e2 |
32 | Integer overflow in octal number at - line 3. |
33 | Illegal octal digit '8' ignored at - line 3. |
34 | Octal number > 037777777777 non-portable at - line 3. |
0453d815 |
35 | Integer overflow in octal number at - line 8. |
9e24b6e2 |
36 | Illegal octal digit '8' ignored at - line 8. |
37 | Octal number > 037777777777 non-portable at - line 8. |
38 | ######## |
4438c4b7 |
39 | # all warnings should be displayed |
40 | use warnings ; |
9e24b6e2 |
41 | my $a = oct "0xfffffffffffffffffg" ; |
42 | EXPECT |
43 | Integer overflow in hexadecimal number at - line 3. |
44 | Illegal hexadecimal digit 'g' ignored at - line 3. |
45 | Hexadecimal number > 0xffffffff non-portable at - line 3. |
46 | ######## |
4438c4b7 |
47 | # all warnings should be displayed |
48 | use warnings ; |
9e24b6e2 |
49 | my $a = oct "0b111111111111111111111111111111111111111111111111111111111111111112"; |
50 | EXPECT |
51 | Integer overflow in binary number at - line 3. |
52 | Illegal binary digit '2' ignored at - line 3. |
53 | Binary number > 0b11111111111111111111111111111111 non-portable at - line 3. |
16ff4256 |
54 | ######## |
55 | |
56 | # Check scope of pragma with eval |
57 | use warnings; |
58 | { |
59 | no warnings ; |
60 | eval ' |
61 | my $a = oct "0xfffffffffffffffffg" ; |
62 | '; print STDERR $@ ; |
63 | my $a = oct "0xfffffffffffffffffg" ; |
64 | } |
65 | EXPECT |
66 | |
67 | ######## |
68 | |
69 | # Check scope of pragma with eval |
70 | use warnings; |
71 | { |
72 | no warnings ; |
73 | eval q[ |
74 | use warnings ; |
75 | my $a = oct "0xfffffffffffffffffg" ; |
76 | ]; print STDERR $@; |
77 | my $a = oct "0xfffffffffffffffffg" ; |
78 | } |
79 | EXPECT |
80 | Integer overflow in hexadecimal number at (eval 1) line 3. |
81 | Illegal hexadecimal digit 'g' ignored at (eval 1) line 3. |
82 | Hexadecimal number > 0xffffffff non-portable at (eval 1) line 3. |
83 | ######## |
84 | |
85 | # Check scope of pragma with eval |
86 | no warnings; |
87 | { |
88 | use warnings ; |
89 | eval ' |
90 | my $a = oct "0xfffffffffffffffffg" ; |
91 | '; print STDERR $@ ; |
92 | } |
93 | EXPECT |
94 | Integer overflow in hexadecimal number at (eval 1) line 2. |
95 | Illegal hexadecimal digit 'g' ignored at (eval 1) line 2. |
96 | Hexadecimal number > 0xffffffff non-portable at (eval 1) line 2. |
97 | ######## |
98 | |
99 | # Check scope of pragma with eval |
100 | no warnings; |
101 | { |
102 | use warnings; |
103 | eval ' |
104 | no warnings ; |
105 | my $a = oct "0xfffffffffffffffffg" ; |
106 | '; print STDERR $@ ; |
107 | } |
108 | EXPECT |
109 | |
110 | ######## |
111 | |
112 | # Check scope of pragma with eval |
113 | no warnings; |
114 | { |
115 | use warnings 'deprecated' ; |
116 | eval ' |
117 | my $a = oct "0xfffffffffffffffffg" ; |
118 | '; print STDERR $@; |
119 | } |
120 | EXPECT |
121 | |