xref: /openbsd/gnu/usr.bin/perl/cpan/Encode/t/utf8ref.t (revision 5759b3d2)
1#
2# $Id: utf8ref.t,v 1.2 2016/10/28 05:03:52 dankogai Exp $
3#
4
5use strict;
6use warnings;
7use Encode;
8use Test::More;
9plan tests => 12;
10#plan 'no_plan';
11
12# my $a = find_encoding('ASCII');
13my $u = find_encoding('UTF-8');
14my $r = [];
15no warnings 'uninitialized';
16is encode_utf8($r), ''.$r;
17is $u->encode($r), ''.$r;
18$r = {};
19is decode_utf8($r), ''.$r;
20is $u->decode($r), ''.$r;
21use warnings 'uninitialized';
22
23is encode_utf8(undef), undef;
24is decode_utf8(undef), undef;
25
26is encode_utf8(''), '';
27is decode_utf8(''), '';
28
29is Encode::encode('utf8', undef), undef;
30is Encode::decode('utf8', undef), undef;
31
32is Encode::encode('utf8', ''), '';
33is Encode::decode('utf8', ''), '';
34