1 # This test that HTML::LinkExtor really absolutize links correctly
2 # when a base URL is given to the constructor.
4 use Test::More tests => 5;
5 require HTML::LinkExtor;
13 # Try with base URL and the $p->links interface.
14 $p = HTML::LinkExtor->new(undef, "http://www.sn.no/foo/foo.html");
15 $p->parse(<<HTML)->eof;
17 <base href="http://www.sn.no/">
19 <body background="http://www.sn.no/sn.gif">
21 This is <A HREF="link.html">link</a> and an <img SRC="img.jpg"
22 lowsrc="img.gif" alt="Image">.
27 # There should be 4 links in the document
31 ($t, %attr) = @$_ if $_->[0] eq 'img';
36 is(delete $attr{src}, "http://www.sn.no/foo/img.jpg");
38 is(delete $attr{lowsrc}, "http://www.sn.no/foo/img.gif");
40 ok(!scalar(keys %attr)); # there should be no more attributes