AozoraBunko-Checkerkun
view release on metacpan or search on metacpan
t/01_basic.t view on Meta::CPAN
use strict;
use warnings;
use utf8;
use AozoraBunko::Checkerkun;
use Test::More;
use Test::Fatal;
binmode Test::More->builder->$_ => ':utf8' for qw/output failure_output todo_output/;
can_ok('AozoraBunko::Checkerkun', qw/new check/);
my %option = (
'gaiji' => 1, # JISå¤åããã§ãã¯ãã
'hansp' => 1, # åè§ã¹ãã¼ã¹ããã§ãã¯ãã
'hanpar' => 1, # åè§ã«ãã³ããã§ãã¯ãã
'zensp' => 0, # å
¨è§ã¹ãã¼ã¹ããã§ãã¯ãã
'zentilde' => 1, # å
¨è§ãã«ãããã§ãã¯ãã
'78hosetsu_tekiyo' => 1, # 78äºæå
æã®å¯¾è±¡ã¨ãªãä¸è¦ãªå¤å注è¨ããã§ãã¯ãã
t/02_options.t view on Meta::CPAN
use strict;
use warnings;
use utf8;
use AozoraBunko::Checkerkun;
use Encode qw//;
use Test::More;
use Test::Fatal;
binmode Test::More->builder->$_ => ':utf8' for qw/output failure_output todo_output/;
my %option = (
'gaiji' => 0, # JISå¤åããã§ãã¯ãã
'hansp' => 0, # åè§ã¹ãã¼ã¹ããã§ãã¯ãã
'hanpar' => 0, # åè§ã«ãã³ããã§ãã¯ãã
'zensp' => 0, # å
¨è§ã¹ãã¼ã¹ããã§ãã¯ãã
'zentilde' => 0, # å
¨è§ãã«ãããã§ãã¯ãã
'78hosetsu_tekiyo' => 0, # 78äºæå
æã®å¯¾è±¡ã¨ãªãä¸è¦ãªå¤å注è¨ããã§ãã¯ãã
'hosetsu_tekiyo' => 0, # å
æã®å¯¾è±¡ã¨ãªãä¸è¦ãªå¤å注è¨ããã§ãã¯ãã
'78' => 0, # 78äºæå
æ29åããã§ãã¯ãã
t/03_html_output.t view on Meta::CPAN
use strict;
use warnings;
use utf8;
use AozoraBunko::Checkerkun;
use Test::More;
binmode Test::More->builder->$_ => ':utf8' for qw/output failure_output todo_output/;
my %option = (
'gaiji' => 0, # JISå¤åããã§ãã¯ãã
'hansp' => 0, # åè§ã¹ãã¼ã¹ããã§ãã¯ãã
'hanpar' => 0, # åè§ã«ãã³ããã§ãã¯ãã
'zensp' => 0, # å
¨è§ã¹ãã¼ã¹ããã§ãã¯ãã
'zentilde' => 0, # å
¨è§ãã«ãããã§ãã¯ãã
'78hosetsu_tekiyo' => 0, # 78äºæå
æã®å¯¾è±¡ã¨ãªãä¸è¦ãªå¤å注è¨ããã§ãã¯ãã
'hosetsu_tekiyo' => 0, # å
æã®å¯¾è±¡ã¨ãªãä¸è¦ãªå¤å注è¨ããã§ãã¯ãã
'78' => 0, # 78äºæå
æ29åããã§ãã¯ãã
t/04_kouetsu.t view on Meta::CPAN
use strict;
use warnings;
use utf8;
use AozoraBunko::Checkerkun;
use Test::More;
binmode Test::More->builder->$_ => ':utf8' for qw/output failure_output todo_output/;
my %option = (
'gaiji' => 0, # JISå¤åããã§ãã¯ãã
'hansp' => 0, # åè§ã¹ãã¼ã¹ããã§ãã¯ãã
'hanpar' => 0, # åè§ã«ãã³ããã§ãã¯ãã
'zensp' => 0, # å
¨è§ã¹ãã¼ã¹ããã§ãã¯ãã
'78hosetsu_tekiyo' => 0, # 78äºæå
æã®å¯¾è±¡ã¨ãªãä¸è¦ãªå¤å注è¨ããã§ãã¯ãã
'hosetsu_tekiyo' => 0, # å
æã®å¯¾è±¡ã¨ãªãä¸è¦ãªå¤å注è¨ããã§ãã¯ãã
'78' => 0, # 78äºæå
æ29åããã§ãã¯ãã
'jyogai' => 0, # æ°JISæ¼¢åã§å
æè¦æºã®é©ç¨é¤å¤ã¨ãªã104åããã§ãã¯ãã
t/09_duplication.t view on Meta::CPAN
use strict;
use warnings;
use utf8;
use AozoraBunko::Checkerkun;
use Test::More;
binmode Test::More->builder->$_ => ':utf8' for qw/output failure_output todo_output/;
subtest 'duplication check for all hiden_no_tare chars' => sub {
plan skip_all => 'duplications are allowed'; # è¤æ°ã®ã¿ã°ãã¤ãããã¨ã§å¯¾å¦ãã
my @key_list = (
keys %{$AozoraBunko::Checkerkun::JYOGAI}
, keys %{$AozoraBunko::Checkerkun::J78}
, keys %{$AozoraBunko::Checkerkun::GONIN1}
, keys %{$AozoraBunko::Checkerkun::GONIN2}
, keys %{$AozoraBunko::Checkerkun::GONIN3}
t/10_control_chars_not_gaiji.t view on Meta::CPAN
use strict;
use warnings;
use utf8;
use AozoraBunko::Checkerkun;
use Test::More;
binmode Test::More->builder->$_ => ':utf8' for qw/output failure_output todo_output/;
my @codepoint_list = (
hex('0000') .. hex('0009')
, hex('000B') .. hex('000C')
, hex('000E') .. hex('001F')
, hex('007F') .. hex('009F')
);
subtest 'check gaiji' => sub {
plan skip_all => 'control chars are allowd since they are marked as "ctrl"';
t/20_jis_x_0208.t view on Meta::CPAN
use strict;
use warnings;
use utf8;
use AozoraBunko::Checkerkun;
use Test::More;
binmode Test::More->builder->$_ => ':utf8' for qw/output failure_output todo_output/;
subtest 'JIS X 0208-1983' => sub {
ok( ! AozoraBunko::Checkerkun::_is_gaiji('é´') );
ok( AozoraBunko::Checkerkun::_is_gaiji('é·') );
};
subtest 'JIS X 0208:1990' => sub {
ok( ! AozoraBunko::Checkerkun::_is_gaiji('ç') );
ok( ! AozoraBunko::Checkerkun::_is_gaiji('å') );
};
( run in 3.348 seconds using v1.01-cache-2.11-cpan-3cd7ad12f66 )