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
CommitLineData
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 5BEGIN {
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
20use Test;
21BEGIN { plan tests => 2 }
22
23use strict;
24use encoding::warnings 'FATAL';
25ok(encoding::warnings->VERSION);
26
27if ($] < 5.008) {
28 ok(1);
29 exit;
30}
31
32my ($a, $b, $c, $ok);
33
34$SIG{__DIE__} = sub {
35 if ($_[0] =~ /upgraded/) { ok(1); exit }
36};
37
38utf8::encode($a = chr(20000));
39$b = chr(20000);
40$c = $a . $b;
41
42ok($ok);