| 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 strictscip-perl cpan Pod-POM-View-Restructured 1.000004 strict/; |
| 10 |
use warningsscip-perl cpan Pod-POM-View-Restructured 1.000004 warnings/; |
| 11 |
|
| 12 |
use Test::Morescip-perl cpan Pod-POM-View-Restructured 1.000004 Test/More/ tests => 5; |
| 13 |
|
| 14 |
use Pod::POM::View::Restructuredscip-perl cpan Pod-POM-View-Restructured 1.000004 Pod/POM/View/Restructured/; |
| 15 |
|
| 16 |
my $conv = Pod::POM::View::Restructured->newscip-perl cpan Pod-POM-View-Restructured 1.000004 Pod/POM/View/Restructured/new().({namespace => "Pod::POM::View::Restructured"}); |
| 17 |
isa_okscip-perl cpan Pod-POM-View-Restructured 1.000004 main/isa_ok().($conv, 'Pod::POM::View::Restructured'); |
| •18 |
|
| 19 |
my $dir = $ENVscip-perl cpan Pod-POM-View-Restructured 1.000004 main/`%ENV`.{AUTOPKGTEST_TMP} ? '/usr/share/perl5' : 'lib'; |
| 20 |
my $rv = $conv->convert_filescip-perl cpan Pod-POM-View-Restructured 1.000004 Pod/POM/View/Restructured/convert_file().("$dir/Pod/POM/View/Restructured.pm"); |
| 21 |
|
| 22 |
okscip-perl cpan Pod-POM-View-Restructured 1.000004 main/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_okscip-perl cpan Pod-POM-View-Restructured 1.000004 main/cmp_ok().($rv->{content}, '=~', $str, "string cmp " . $count++); |
| 36 |
} |