This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
t/re/regexp_unicode_prop.t: Avoid a TEST crash if failure
[perl5.git] / dist / 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     if ("$]" >= 5.025) {
7       print "1..0 # Skip: encoding::warnings not supported on perl 5.26\n";
8       exit 0;
9     }
10     if (ord("A") != 65) {
11       print "1..0 # Skip: Encode not working on EBCDIC\n";
12       exit 0;
13     }
14     unless (eval { require Encode } ) {
15         print "1..0 # Skip: no Encode\n";
16         exit 0;
17     }
18 }
19
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);