This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Start refactoring convert_n_test()
[perl5.git] / ext / Pod-Html / t / htmldir4.t
1 #!/usr/bin/perl -w                                         # -*- perl -*-
2
3 BEGIN {
4     require "./t/pod2html-lib.pl";
5 }
6
7 use strict;
8 use Cwd;
9 use File::Spec::Functions ':ALL';
10 use Test::More tests => 2;
11
12 my $cwd = cwd();
13 my $data_pos = tell DATA; # to read <DATA> twice
14
15 convert_n_test("htmldir4", "test --htmldir and --htmlroot 4a", 
16  "--podpath=t",
17  "--htmldir=t",
18  "--outfile=". catfile('t', 'htmldir4.html'),
19  "--quiet",
20 );
21
22 seek DATA, $data_pos, 0; # to read <DATA> twice (expected output is the same)
23
24 convert_n_test("htmldir4", "test --htmldir and --htmlroot 4b", 
25  "--podpath=t",
26  "--podroot=$cwd",
27  "--htmldir=". catdir($cwd, 't'),
28  "--norecurse",
29  "--quiet",
30 );
31
32 __DATA__
33 <?xml version="1.0" ?>
34 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
35 <html xmlns="http://www.w3.org/1999/xhtml">
36 <head>
37 <title>htmldir - Test --htmldir feature</title>
38 <meta http-equiv="content-type" content="text/html; charset=utf-8" />
39 <link rev="made" href="mailto:[PERLADMIN]" />
40 </head>
41
42 <body>
43
44
45
46 <ul id="index">
47   <li><a href="#NAME">NAME</a></li>
48   <li><a href="#LINKS">LINKS</a></li>
49 </ul>
50
51 <h1 id="NAME">NAME</h1>
52
53 <p>htmldir - Test --htmldir feature</p>
54
55 <h1 id="LINKS">LINKS</h1>
56
57 <p>Normal text, a <a>link</a> to nowhere,</p>
58
59 <p>a link to <a>perlvar-copy</a>,</p>
60
61 <p><a href="t/htmlescp.html">htmlescp</a>,</p>
62
63 <p><a href="t/feature.html#Another-Head-1">&quot;Another Head 1&quot; in feature</a>,</p>
64
65 <p>and another <a href="t/feature.html#Another-Head-1">&quot;Another Head 1&quot; in feature</a>.</p>
66
67
68 </body>
69
70 </html>
71
72