File: 54dom-filling.t

package info (click to toggle)
libparse-man-perl 0.03-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 184 kB
  • sloc: perl: 1,426; makefile: 2
file content (40 lines) | stat: -rw-r--r-- 623 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
29
30
31
32
33
34
35
36
37
38
39
40
#!/usr/bin/perl

use v5.14;
use warnings;

use Test::More;

use Parse::Man::DOM;

my $parser = Parse::Man::DOM->new;

sub paras_from
{ 
   my $document = $parser->from_string( $_[0] );
   return $document->paras;
}

my @paras;

@paras = paras_from <<'EOMAN';
Plain text
EOMAN
is( $paras[0]->filling, 1, 'filling defaults true' );

@paras = paras_from <<'EOMAN';
.nf
No-filled text
EOMAN
is( $paras[0]->filling, 0, '.nf disables filling' );

@paras = paras_from <<'EOMAN';
.nf
No-filled text
.fi
Filled text
EOMAN
is( $paras[0]->filling, 0, '.nf first para' );
is( $paras[1]->filling, 1, '.fi second para' );

done_testing;