~ubuntu-branches/ubuntu/jaunty/libtest-html-content-perl/jaunty

« back to all changes in this revision

Viewing changes to t/03-links.t

  • Committer: Bazaar Package Importer
  • Author(s): Dominic Hargreaves
  • Date: 2006-06-13 14:06:41 UTC
  • Revision ID: james.westby@ubuntu.com-20060613140641-jfjxdjhpkaydlkbj
Tags: upstream-0.07
ImportĀ upstreamĀ versionĀ 0.07

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/perl -w
 
2
use strict;
 
3
use lib 't';
 
4
use testlib;
 
5
 
 
6
sub run {
 
7
  # Tests for links
 
8
  no_link('<html></html>','http://www.perl.com', "Simple non-existing link");
 
9
  no_link('<html>http://www.perl.com</html>',"http://www.perl.com", "Plain text gets not interpreted as link");
 
10
  link_ok('<html><a href="http://www.perl.com">Title</a></html>',"http://www.perl.com", "A link is found");
 
11
  link_count('<html><A href="http://www.perl.com">Icon</a><a href="http://www.perl.com">Title</a></html>',"http://www.perl.com", 2,"A link that appears twice is reported twice");
 
12
 
 
13
  link_ok('<html>Mail me at <!-- href="corion@cpan.org" -->
 
14
                    <a href="corion@somewhere.else"></a> some address</html>',
 
15
      'corion@somewhere.else', "Links are not found if commented out");
 
16
};
 
17
 
 
18
runtests(5,\&run);
 
 
b'\\ No newline at end of file'