| 1 |
#!/usr/bin/env perl |
| 2 |
# |
| 3 |
# Copyright (c) 2016 Jeff Fearn <[email protected]> |
| 4 |
# Copyright (c) 2026 Alex Muntada <[email protected]> |
| 5 |
# |
| 6 |
# This is free software; you can redistribute it and/or modify it under |
| 7 |
# the same terms as Perl itself. See perlartistic. |
| 8 |
|
| 9 |
use strict; |
| 10 |
use warnings; |
| 11 |
|
| 12 |
use Test::More tests => 5; |
| 13 |
|
| 14 |
use Pod::POM::View::Restructured; |
| 15 |
|
| 16 |
my $conv = Pod::POM::View::Restructured->new({namespace => "Pod::POM::View::Restructured"}); |
| 17 |
isa_ok($conv, 'Pod::POM::View::Restructured'); |
| •18 |
|
| 19 |
my $dir = $ENV{AUTOPKGTEST_TMP} ? '/usr/share/perl5' : 'lib'; |
| 20 |
my $rv = $conv->convert_file("$dir/Pod/POM/View/Restructured.pm"); |
| 21 |
|
| 22 |
ok($rv); |
| 23 |
|
| 24 |
# An array of RST strings we should get in the output |
| 25 |
# You will have to escape any quanity chars. e.g. ?, *, etc. |
| 26 |
my @expected = ( |
| 27 |
'.. _Pod::POM::View::Restructured:', |
| 28 |
'.. _Pod::POM::View::Restructured::NAME:', |
| 29 |
'`Pod::POM <https://metacpan.org/search\?q=Pod%3a%3aPOM>`_' |
| 30 |
); |
| 31 |
|
| 32 |
my $count = 0; |
| 33 |
|
| 34 |
foreach my $str (@expected) { |
| 35 |
cmp_ok($rv->{content}, '=~', $str, "string cmp " . $count++); |
| 36 |
} |