1BEGIN { 2 use File::Spec::Functions ':ALL'; 3 @INC = map { rel2abs($_) } 4 (qw| ./lib ./t/lib ../../lib |); 5} 6 7use strict; 8use warnings; 9use Test::More; 10use Testing qw( setup_testing_dir xconvert ); 11use Cwd; 12 13my $debug = 0; 14my $startdir = cwd(); 15END { chdir($startdir) or die("Cannot change back to $startdir: $!"); } 16my ($expect_raw, $args); 17{ local $/; $expect_raw = <DATA>; } 18 19my $tdir = setup_testing_dir( { 20 debug => $debug, 21} ); 22 23my $cwd = cwd(); 24 25my $warn; 26$SIG{__WARN__} = sub { $warn .= $_[0] }; 27 28$args = { 29 podstub => "feature2", 30 description => "misc pod-html features 2", 31 expect => $expect_raw, 32 p2h => { 33 backlink => 1, 34 header => 1, 35 podpath => '.', 36 podroot => $cwd, 37 norecurse => 1, 38 verbose => 1, 39 }, 40 debug => $debug, 41}; 42xconvert($args); 43 44like($warn, 45 qr( 46 \Acaching\ directories\ for\ later\ use\n 47 Converting\ input\ file\ \S+[/\\\]]feature2\.pod\n 48 Cannot\ find\ file\ "crossref\.\*"\ directly\ under\ podpath,\ cannot\ find 49 \ suitable\ replacement:\ link\ remains\ unresolved\.\n\z 50 )x, 51 "misc pod-html --verbose warnings"); 52 53done_testing; 54 55__DATA__ 56<?xml version="1.0" ?> 57<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 58<html xmlns="http://www.w3.org/1999/xhtml"> 59<head> 60<title></title> 61<meta http-equiv="content-type" content="text/html; charset=utf-8" /> 62<link rev="made" href="mailto:[PERLADMIN]" /> 63</head> 64 65<body id="_podtop_"> 66<table border="0" width="100%" cellspacing="0" cellpadding="3"> 67<tr><td class="_podblock_" style="background-color: #cccccc; color: #000" valign="middle"> 68<big><strong><span class="_podblock_"> </span></strong></big> 69</td></tr> 70</table> 71 72 73 74<ul id="index"> 75 <li><a href="#Head-1">Head 1</a></li> 76 <li><a href="#Another-Head-1">Another Head 1</a></li> 77</ul> 78 79<a href="#_podtop_"><h1 id="Head-1">Head 1</h1></a> 80 81<p>A paragraph</p> 82 83 84 85some html 86 87<p>Another paragraph</p> 88 89<a href="#_podtop_"><h1 id="Another-Head-1">Another Head 1</h1></a> 90 91<p>some text and a link <a>crossref</a></p> 92 93<table border="0" width="100%" cellspacing="0" cellpadding="3"> 94<tr><td class="_podblock_" style="background-color: #cccccc; color: #000" valign="middle"> 95<big><strong><span class="_podblock_"> </span></strong></big> 96</td></tr> 97</table> 98 99</body> 100 101</html> 102 103 104