File: headparser-http.t

package info (click to toggle)
libhtml-parser-perl 3.56-1%2Blenny1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 536 kB
  • ctags: 192
  • sloc: ansic: 1,985; perl: 1,935; makefile: 43
file content (20 lines) | stat: -rw-r--r-- 365 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
use Test::More tests => 1;

eval {
   require HTML::HeadParser;
   $p = HTML::HeadParser->new;
};

SKIP: {
skip $@, 1 if $@ =~ /^Can't locate HTTP/;

$p = HTML::HeadParser->new($h);
$p->parse(<<EOT);
<title>Stupid example</title>
<base href="http://www.sn.no/libwww-perl/">
Normal text starts here.
EOT
$h = $p->header;
undef $p;
is($h->title, "Stupid example");
}