File: 02items.t

package info (click to toggle)
libpod-pom-view-restructured-perl 1.000003-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 188 kB
  • sloc: perl: 668; makefile: 2
file content (36 lines) | stat: -rw-r--r-- 678 bytes parent folder | download | duplicates (2)
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
#!/usr/bin/env perl
#

use strict;
use warnings;

use Test::More;

use Pod::POM::View::Restructured;

my $conv = Pod::POM::View::Restructured->new({namespace => "Pod::POM::View::Restructured"});
isa_ok($conv, 'Pod::POM::View::Restructured');

use Cwd;
my $dir = getcwd;
my $rv = $conv->convert_file("$dir/t/test.pod");

ok($rv);

# An array of RST strings we should get in the output
# You will ahve to escape any quanity chars. e.g. ?, *, etc.
my @expected = (
    '- item1',
    '- item2',
    '* item3',
    '+ item4',
    '- item5',
);

my $count = 0;

foreach my $str (@expected) {
    cmp_ok($rv->{content}, '=~', "\Q$str\E", "string cmp " . $count++);
}

done_testing();