rewrite home page redirect
[dh-make-perl] / dev / arm / libhtml-parser-perl / libhtml-parser-perl-3.56 / t / document.t
1 #!perl -w
2
3 use Test;
4 plan tests => 6;
5
6
7 use HTML::Parser;
8 use File::Spec;
9
10 my $events;
11 my $p = HTML::Parser->new(default_h => [sub { $events .= "$_[0]\n";}, "event"]);
12
13 $events = "";
14 $p->eof;
15 ok($events, "start_document\nend_document\n");
16
17 $events = "";
18 $p->parse_file(File::Spec->devnull);
19 ok($events, "start_document\nend_document\n");
20
21 $events = "";
22 $p->parse("");
23 $p->eof;
24 ok($events, "start_document\nend_document\n");
25
26 $events = "";
27 $p->parse("");
28 $p->parse("");
29 $p->eof;
30 ok($events, "start_document\nend_document\n");
31
32 $events = "";
33 $p->parse("");
34 $p->parse("<a>");
35 $p->eof;
36 ok($events, "start_document\nstart\nend_document\n");
37
38 $events = "";
39 $p->parse("<a> ");
40 $p->eof;
41 ok($events, "start_document\nstart\ntext\nend_document\n");