root/HTML-ResolveLink/trunk/t/01_resolve.t

Revision 1785 (checked in by miyagawa, 14 years ago)

import HTML::ResolveLink?

  • Property svn:mime-type set to text/plain
Line 
1 use strict;
2 use Test::More 'no_plan';
3 use HTML::ResolveLink;
4
5 my $base = "http://www.example.com/base/";
6
7 my $resolver = HTML::ResolveLink->new(base => $base);
8 my $html = $resolver->resolve(<<'HTML');
9 <a href="/foo">foo</a><img src="/bar.gif" alt="foo &amp; bar" /> foobar
10 <a href="mailto:foobar@example.com">hey &amp;</a>
11 <a href="foo.html" onclick="foobar()">bar</a><br />
12 <a href="http://www.example.net/">bar</a>
13 <!-- hello -->
14 HTML
15     ;
16
17 is $html, <<'HTML';
18 <a href="http://www.example.com/foo">foo</a><img src="http://www.example.com/bar.gif" alt="foo &amp; bar" /> foobar
19 <a href="mailto:foobar@example.com">hey &amp;</a>
20 <a href="http://www.example.com/base/foo.html" onclick="foobar()">bar</a><br />
21 <a href="http://www.example.net/">bar</a>
22 <!-- hello -->
23 HTML
24     ;
Note: See TracBrowser for help on using the browser.