Commit | Line | Data |
0453d815 |
1 | Check default warnings |
2 | |
3 | __END__ |
4 | # default warning should be displayed if you don't add anything |
5 | # optional shouldn't |
6 | my $a = oct "7777777777777777777777777777777777779" ; |
7 | EXPECT |
8 | Integer overflow in octal number at - line 3. |
9 | ######## |
10 | # no warning should be displayed |
11 | no warning ; |
9e24b6e2 |
12 | my $a = oct "7777777777777777777777777777777777778" ; |
0453d815 |
13 | EXPECT |
14 | ######## |
15 | # all warning should be displayed |
16 | use warning ; |
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 |
24 | use warning ; |
9e24b6e2 |
25 | my $a = oct "7777777777777777777777777777777777778" ; |
0453d815 |
26 | { |
27 | no warning ; |
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 | ######## |
39 | # all warning should be displayed |
40 | use warning ; |
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 | ######## |
47 | # all warning should be displayed |
48 | use warning ; |
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. |