File: SortedAttributes.t

package info (click to toggle)
libmarkdent-perl 0.40-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,372 kB
  • sloc: perl: 5,225; sh: 24; makefile: 13
file content (44 lines) | stat: -rw-r--r-- 737 bytes parent folder | download | duplicates (3)
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
43
44
use strict;
use warnings;

use Test2::V0;

use Markdent::Simple::Fragment;

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

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

<a rel="license" href="https://cpan.org">CPAN with rel</a>

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

* a list
* with items

That is all
EOF

my $expect = <<'EOF';
<h1>A header
</h1><p><a href="https://cpan.org" rel="license">CPAN with rel</a>
</p><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>
EOF

chomp $expect;

is(
    $mds->markdown_to_html( markdown => $markdown ),
    $expect,
    'Markdent::Simple::Fragment returns tags with sorted HTML attributes'
);

done_testing();