File: 04fold.t

package info (click to toggle)
libunicode-linebreak-perl 0.0.20160702-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 1,020 kB
  • ctags: 755
  • sloc: perl: 782; makefile: 6
file content (28 lines) | stat: -rw-r--r-- 897 bytes parent folder | download
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
use strict;
use Test::More;
require "t/lf.pl";

BEGIN { plan tests => 15 + 2 }

foreach my $lang (qw(fr ja quotes)) {
    do5tests($lang, $lang);
}    

my $in = <<EOF;
This is a very long piece of text that wraps appropriately to have a From at the start of the line. From should be space indented.
 It never wraps at a space so let us start this paragraph with one so that the behaviour there can be observed; it should have two spaces.
EOF
my $out = <<EOF;
This is a very long piece of text that wraps appropriately to have a  
 From at the start of the line. From should be space indented. 

  It never wraps at a space so let us start this paragraph with one so  
that the behaviour there can be observed; it should have two spaces. 

EOF
my $lf = Text::LineFold->new(ColMax => 72);
is($lf->fold($in, 'FLOWED'), $out, 'CPAN RT 115146');
is($lf->unfold($out, 'FLOWED'), $in, 'reversal');

1;