This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
4fc16a1df6fd3a3d54d7392ab8c7228e23998d1e
[perl5.git] / ext / encoding-warnings / t / 2-fatal.t
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
5 BEGIN {
6     unless (eval { require Encode } ) {
7         print "1..0 # Skip: no Encode\n";
8         exit 0;
9     }
10 }
11
12 use Test;
13 BEGIN { plan tests => 2 }
14
15 use strict;
16 use encoding::warnings 'FATAL';
17 ok(encoding::warnings->VERSION);
18
19 if ($] < 5.008) {
20     ok(1);
21     exit;
22 }
23
24 my ($a, $b, $c, $ok);
25
26 $SIG{__DIE__} = sub {
27     if ($_[0] =~ /upgraded/) { ok(1); exit }
28 };
29
30 utf8::encode($a = chr(20000));
31 $b = chr(20000);
32 $c = $a . $b;
33
34 ok($ok);