File: lists.t

package info (click to toggle)
libwiki-toolkit-formatter-usemod-perl 0.25-1.1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 176 kB
  • sloc: perl: 258; makefile: 2
file content (39 lines) | stat: -rw-r--r-- 826 bytes parent folder | download | duplicates (6)
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
use strict;
use Test::More tests => 6;

use Wiki::Toolkit::Formatter::UseMod;

my $formatter = Wiki::Toolkit::Formatter::UseMod->new;

# Test unordered lists.
my $wikitext = <<WIKI;

* list item 1
* list item 2

 * another list item 1

* foo 1
** bar 1
** bar 2
* foo 2

WIKI

my $html = $formatter->format( $wikitext );
like( $html, qr/<li>list item 1<\/li>/, "unordered lists work" );
like( $html, qr/<li>another list item 1<\/li>/, "...also when indented" );
like( $html, qr/<li>foo 1/, "...first level of nested list" );
like( $html, qr/<ul>\s*<li>bar 1<\/li>/s, "...second level of nested list" );

# Test ordered lists.
$wikitext = <<WIKI;

1. item 1
2. item 2

WIKI

$html = $formatter->format( $wikitext );
like( $html, qr/<ol>/, "ordered list created" );
like( $html, qr/<li value="1">item 1/, "items are ordered" );