This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
c7525aef1fceab93310e06cf5446fb6711184c31
[perl5.git] / ext / encoding-warnings / t / 1-warning.t
1 #!/usr/bin/perl
2 # $File: /member/local/autrijus/encoding-warnings//t/1-warning.t $ $Author: autrijus $
3 # $Revision: #5 $ $Change: 6145 $ $DateTime: 2004-07-16T03:49:06.717424Z $
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;
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{__WARN__} = 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);
35
36 __END__