summaryrefslogtreecommitdiff
path: root/lib/encoding/warnings
diff options
context:
space:
mode:
Diffstat (limited to 'lib/encoding/warnings')
-rw-r--r--lib/encoding/warnings/t/3-normal.t4
-rw-r--r--lib/encoding/warnings/t/4-lexical.t41
2 files changed, 41 insertions, 4 deletions
diff --git a/lib/encoding/warnings/t/3-normal.t b/lib/encoding/warnings/t/3-normal.t
index f573a86673..f0e6446a56 100644
--- a/lib/encoding/warnings/t/3-normal.t
+++ b/lib/encoding/warnings/t/3-normal.t
@@ -1,7 +1,3 @@
-#!/usr/bin/perl
-# $File: /member/local/autrijus/encoding-warnings/t/3-normal.t $ $Author: autrijus $
-# $Revision: #3 $ $Change: 1625 $ $DateTime: 2004-03-14T16:50:26.012462Z $
-
use Test;
BEGIN { plan tests => 2 }
diff --git a/lib/encoding/warnings/t/4-lexical.t b/lib/encoding/warnings/t/4-lexical.t
new file mode 100644
index 0000000000..5031cf37c2
--- /dev/null
+++ b/lib/encoding/warnings/t/4-lexical.t
@@ -0,0 +1,41 @@
+use strict;
+use Test;
+BEGIN { plan tests => 3 }
+
+{
+ use encoding::warnings;
+ ok(encoding::warnings->VERSION);
+
+ if ($] < 5.009004) {
+ ok('skipped');
+ ok('skipped');
+ exit;
+ }
+
+ my ($a, $b, $c, $warned);
+
+ local $SIG{__WARN__} = sub {
+ if ($_[0] =~ /upgraded/) { $warned = 1 }
+ };
+
+ utf8::encode($a = chr(20000));
+ $b = chr(20000);
+ $c = $a . $b;
+ ok($warned);
+}
+
+{
+ my ($a, $b, $c, $warned);
+
+ local $SIG{__WARN__} = sub {
+ if ($_[0] =~ /upgraded/) { $warned = 1 }
+ };
+
+ utf8::encode($a = chr(20000));
+ $b = chr(20000);
+ $c = $a . $b;
+ ok(!$warned);
+}
+
+
+__END__