summaryrefslogtreecommitdiff
path: root/cpan/Encode/t
diff options
context:
space:
mode:
Diffstat (limited to 'cpan/Encode/t')
-rw-r--r--cpan/Encode/t/decode.t2
-rw-r--r--cpan/Encode/t/enc_eucjp.t2
-rw-r--r--cpan/Encode/t/xml.t22
3 files changed, 24 insertions, 2 deletions
diff --git a/cpan/Encode/t/decode.t b/cpan/Encode/t/decode.t
index 0c3b6697f4..66723f4423 100644
--- a/cpan/Encode/t/decode.t
+++ b/cpan/Encode/t/decode.t
@@ -1,5 +1,5 @@
#
-# $Id: decode.t,v 1.4 2017/10/06 22:21:53 dankogai Exp $
+# $Id: decode.t,v 1.5 2019/01/31 04:26:40 dankogai Exp $
#
use strict;
use Encode qw(decode_utf8 FB_CROAK find_encoding decode);
diff --git a/cpan/Encode/t/enc_eucjp.t b/cpan/Encode/t/enc_eucjp.t
index 8f933b0063..84548af0d6 100644
--- a/cpan/Encode/t/enc_eucjp.t
+++ b/cpan/Encode/t/enc_eucjp.t
@@ -1,4 +1,4 @@
-# $Id: enc_eucjp.t,v 2.5 2017/06/10 17:23:50 dankogai Exp $
+# $Id: enc_eucjp.t,v 2.6 2019/01/31 04:26:40 dankogai Exp $
# This is the twin of enc_utf8.t .
BEGIN {
diff --git a/cpan/Encode/t/xml.t b/cpan/Encode/t/xml.t
new file mode 100644
index 0000000000..2c7e721d91
--- /dev/null
+++ b/cpan/Encode/t/xml.t
@@ -0,0 +1,22 @@
+use strict;
+use warnings;
+
+use Encode;
+use Test::More;
+
+my $content = String->new("--\x{30c6}--");
+my $text = Encode::encode('latin1', $content, Encode::FB_XMLCREF);
+is $text, "--テ--";
+
+done_testing;
+
+package String;
+use overload
+ '""' => sub { ${$_[0]} }, fallback => 1;
+
+sub new {
+ my($class, $str) = @_;
+ bless \$str, $class;
+}
+
+1;