summaryrefslogtreecommitdiff
path: root/cpan/dist/HTML-FromText/t/03_v2.02.t
blob: 8eec81afbc4d2817aaf3b93d8b37d00c8be389a7 (plain)
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
use Test::More;

my $script = 'blib/script/text2html';

plan skip_all => "$script doesn't exist"
  unless -e $script;

plan 'no_plan';

open T2H, "perl -Iblib/lib $script --paras t/files/paras.txt |" or die $!;
undef $/;
my $html = <T2H>;
close T2H;

cmp_ok( $html, 'eq', <<__HTML__, 'output from text2html correct' );
<p class="hft-paras">Hello</p>

<p class="hft-paras">Test</p>
__HTML__

use_ok 'HTML::FromText';

$html = text2html( <<__TEXT__, paras => 1, blockcode => 1 );
  Foo Bar
__TEXT__
cmp_ok( $html, 'eq', <<__HTML__, 'blockcode should preserve spaces' );
<blockquote class="hft-blockcode"><pre>Foo Bar</pre></blockquote>
__HTML__