Locale-Utils-Autotranslator
view release on metacpan or search on metacpan
t/11_with_paragraphs_utf-8.t view on Meta::CPAN
#!perl
use strict;
use warnings;
use utf8;
use Test::More tests => 3;
use Test::Differences;
use Test::NoWarnings;
use Locale::Utils::Autotranslator;
my $auto_translator = Locale::Utils::Autotranslator->new(language => 'de');
eq_or_diff
$auto_translator->with_paragraphs(
" \t foo \n\nb ä \t r\n \n \n\n\n baz\nbam \t ",
sub {
return "-$_-";
},
),
" \t -foo- \n\n-b ä \t r-\n\n \n\n\n -baz\nbam- \t ",
'with_paragraphs';
eq_or_diff
$auto_translator->with_paragraphs(
"foo\r\n\r\nbär\r\nbaz",
sub {
return "-$_-";
},
),
"-foo-\r\n\r\n-bär\r\nbaz-",
'with_paragraphs (network line endings)';
( run in 0.750 second using v1.01-cache-2.11-cpan-5a3173703d6 )