xref: /openbsd-src/gnu/usr.bin/perl/dist/encoding-warnings/t/2-fatal.t (revision e068048151d29f2562a32185e21a8ba885482260)
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
5BEGIN {
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
20use Test::More tests => 2;
21
22use strict;
23use warnings;
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);
43