File: basic.t

package info (click to toggle)
libxml-sax-expat-incremental-perl 0.04-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 56 kB
  • ctags: 14
  • sloc: perl: 154; makefile: 45
file content (27 lines) | stat: -rw-r--r-- 579 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/usr/bin/perl

# pretty much the example test from L<XML::SAX>

use Test::More tests => 3;

use XML::SAX;
use XML::SAX::PurePerl::DebugHandler;

XML::SAX->add_parser(q(XML::SAX::Expat::Incremental));

local $XML::SAX::ParserPackage = 'XML::SAX::Expat::Incremental';

isa_ok(
	my $handler = XML::SAX::PurePerl::DebugHandler->new(),
	"XML::SAX::PurePerl::DebugHandler",
);

isa_ok(
	my $parser = XML::SAX::ParserFactory->parser(Handler => $handler),
	"XML::SAX::Expat::Incremental",
);

$parser->parse_string("<tag/>");

ok($handler->{seen}{start_element}, "parsed something");