blob: fa40c89221d0cefaa5c7e455b86c99fd0ce5d407 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
## ----------------------------------------------------------------------------
# t/v045_getcode.t
# -----------------------------------------------------------------------------
# $Id$
# -----------------------------------------------------------------------------
use strict;
use Test::More;
use Unicode::Japanese;
# xs is loaded in first invocation of `new'.
my $xs = Unicode::Japanese->new();
my $pp = Unicode::Japanese::PurePerl->new();
# to avoid used-only-once warning, read twice.
my $err = ($Unicode::Japanese::xs_loaderror,$Unicode::Japanese::xs_loaderror)[0];
if( $err =~ /Can't locate loadable object/ )
{
plan skip_all => 'no xs module';
}
plan tests => 2;
# f340 is available on both au and doti.
# But f040 is available on only doti.
my $str = "\xf3\x40\xf0\x40";
is($xs->getcode($str), "sjis-doti", "xs");
is($pp->getcode($str), "sjis-doti", "pp");
|