File: Document.t

package info (click to toggle)
libmarkdent-perl 0.40-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,368 kB
  • sloc: perl: 5,225; sh: 24; makefile: 13
file content (42 lines) | stat: -rw-r--r-- 683 bytes parent folder | download | duplicates (4)
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
41
42
use strict;
use warnings;

use Test2::V0;

use Markdent::Simple::Document;

my $mds = Markdent::Simple::Document->new();

my $markdown = <<'EOF';
A header
========

Some *text* with **markup**
in a paragraph.

* a list
* with items

That is all
EOF

my $expect = <<'EOF';
<!DOCTYPE html>
<html><head><title>Test</title></head><body><h1>A header
</h1><p>Some <em>text</em> with <strong>markup</strong>
in a paragraph.
</p><ul><li>a list
</li><li>with items
</li></ul><p>That is all
</p></body></html>
EOF

chomp $expect;

is(
    $mds->markdown_to_html( title => 'Test', markdown => $markdown ),
    $expect,
    'Markdent::Simple::Document returns expected HTML'
);

done_testing();