Subject: | case => "sentence" capitalizes paragraphs rather than sentences |
case => "sentence" capitalizes paragraphs rather than sentences
Test script included below and attached.
- ask
#!/usr/bin/perl
use strict;
use warnings;
use Text::Autoformat;
use Test::More qw(no_plan);
my $input = "LOREM IPSUM DOLOR SIT AMET, CONSECTETUER ADIPISCING ELIT. ETIAM
INTERDUM ULTRICES MAGNA.
FUSCE EU DIAM.";
my $expected = "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Etiam interdum
ultrices magna.
Fusce eu diam.";
my $output = autoformat $input, { case => 'sentences',
all => 1,
right => length($input),
};
is($output, $expected, "correct capitalization");
$ /pkg/bin/prove -v /tmp/af_sent.pl
/tmp/af_sent....not ok 1 - correct capitalization
# Failed test 'correct capitalization'
# at /tmp/af_sent.pl line 20.
# got: 'Lorem ipsum dolor sit amet, consectetuer adipiscing elit. etiam interdum ultrices
magna.
#
# Fusce eu diam.
# '
# expected: 'Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Etiam interdum
ultrices magna.
#
# Fusce eu diam.'
1..1
# Looks like you failed 1 test of 1.
Subject: | af_sent.pl |
#!/usr/bin/perl
use strict;
use warnings;
use Text::Autoformat;
use Test::More qw(no_plan);
my $input = "LOREM IPSUM DOLOR SIT AMET, CONSECTETUER ADIPISCING ELIT. ETIAM INTERDUM ULTRICES MAGNA.
FUSCE EU DIAM.";
my $expected = "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Etiam interdum ultrices magna.
Fusce eu diam.";
my $output = autoformat $input, { case => 'sentences',
all => 1,
right => length($input),
};
is($output, $expected, "correct capitalization");