Aozora2Epub
view release on metacpan or search on metacpan
t/okuzuke.t view on Meta::CPAN
use strict;
use warnings;
use utf8;
use Test::More;
use Test::Base;
use Aozora2Epub::XHTML;
use Aozora2Epub::Gensym;
use lib qw/./;
use t::Util;
sub drop_nlsp {
my $s = shift;
$s =~ s/\n *//sg;
$s =~ s/\n$//sg;
$s;
}
filters {
html => 'chomp',
expected => ['chomp', 'drop_nlsp'],
};
run {
my $block = shift;
Aozora2Epub::Gensym->reset_counter;
my $x = Aozora2Epub::XHTML->new_from_string($block->html);
is($x->bib_info, $block->expected, $block->name);
};
done_testing;
__DATA__
=== normal
--- html
<div class="bibliographical_information">
<hr>
<br>
奥ä»<br>
ãã©ã³ãã£ã¢ã®çããã§ãã<br>
<br>
<br>
</div>
--- expected
奥ä»<br />
ãã©ã³ãã£ã¢ã®çããã§ãã
=== less br
--- html
<div class="bibliographical_information">
<hr>
<br>
åºæ¬
<br>
ãã©ã³ãã£ã¢ã®çããã§ãã<br>
<br>
</div>
--- expected
åºæ¬<br />
ãã©ã³ãã£ã¢ã®çããã§ãã
=== zenkaku space indentation
--- html
( run in 1.110 second using v1.01-cache-2.11-cpan-8f98c5d2c55 )