Upgrade to encoding-warnings-0.10
[p5sagit/p5-mst-13.2.git] / lib / encoding / warnings / t / 4-lexical.t
1 use strict;
2 use Test;
3 BEGIN { plan tests => 3 }
4
5 {
6     use encoding::warnings;
7     ok(encoding::warnings->VERSION);
8
9     if ($] < 5.009004) {
10         ok('skipped');
11         ok('skipped');
12         exit;
13     }
14
15     my ($a, $b, $c, $warned);
16
17     local $SIG{__WARN__} = sub {
18         if ($_[0] =~ /upgraded/) { $warned = 1 }
19     };
20
21     utf8::encode($a = chr(20000));
22     $b = chr(20000);
23     $c = $a . $b;
24     ok($warned);
25 }
26
27 {
28     my ($a, $b, $c, $warned);
29
30     local $SIG{__WARN__} = sub {
31         if ($_[0] =~ /upgraded/) { $warned = 1 }
32     };
33
34     utf8::encode($a = chr(20000));
35     $b = chr(20000);
36     $c = $a . $b;
37     ok(!$warned);
38 }
39
40
41 __END__