Commit | Line | Data |
---|---|---|
de1df517 RGS |
1 | #!/usr/bin/perl |
2 | # $File: /member/local/autrijus/encoding-warnings/t/2-fatal.t $ $Author: autrijus $ | |
3 | # $Revision: #4 $ $Change: 1626 $ $DateTime: 2004-03-14T16:53:19.351256Z $ | |
4 | ||
5b279f8b | 5 | BEGIN { |
b9071370 FC |
6 | if ("$]" >= 5.025) { |
7 | print "1..0 # Skip: encoding::warnings not supported on perl 5.26\n"; | |
8 | exit 0; | |
9 | } | |
d4a45aba KW |
10 | if (ord("A") != 65) { |
11 | print "1..0 # Skip: Encode not working on EBCDIC\n"; | |
12 | exit 0; | |
13 | } | |
5b279f8b NC |
14 | unless (eval { require Encode } ) { |
15 | print "1..0 # Skip: no Encode\n"; | |
16 | exit 0; | |
17 | } | |
18 | } | |
19 | ||
de1df517 RGS |
20 | use Test; |
21 | BEGIN { plan tests => 2 } | |
22 | ||
23 | use strict; | |
24 | use encoding::warnings 'FATAL'; | |
25 | ok(encoding::warnings->VERSION); | |
26 | ||
27 | if ($] < 5.008) { | |
28 | ok(1); | |
29 | exit; | |
30 | } | |
31 | ||
32 | my ($a, $b, $c, $ok); | |
33 | ||
34 | $SIG{__DIE__} = sub { | |
35 | if ($_[0] =~ /upgraded/) { ok(1); exit } | |
36 | }; | |
37 | ||
38 | utf8::encode($a = chr(20000)); | |
39 | $b = chr(20000); | |
40 | $c = $a . $b; | |
41 | ||
42 | ok($ok); |