File: argspec2.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 (21 lines) | stat: -rw-r--r-- 354 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
21
use Test::More tests => 2;

use strict;
use HTML::Parser;

my @start;
my @text;

my $p = HTML::Parser->new(api_version => 3);
$p->handler(start => \@start, '@{tagname, @attr}');
$p->handler(text  => \@text,  '@{dtext}');
$p->parse(<<EOT)->eof;
Hi
<a href="abc">Foo</a><b>:-)</b>
EOT

is("@start", "a href abc b");

is(join("", @text), "Hi\nFoo:-)\n");