Add ARM files
[dh-make-perl] / dev / arm / libhtml-parser-perl / libhtml-parser-perl-3.56 / t / plaintext.t
1 use Test::More tests => 2;
2
3 use strict;
4 use HTML::Parser;
5
6 my @a;
7 my $p = HTML::Parser->new(api_version => 3);
8 $p->handler(default => \@a, '@{event, text, is_cdata}');
9 $p->parse(<<EOT)->eof;
10 <xmp><foo></xmp>x<plaintext><foo>
11 </plaintext>
12 foo
13 EOT
14
15 for (@a) {
16     $_ = "" unless defined;
17 }
18
19 my $doc = join(":", @a);
20
21 #diag $doc;
22
23 is($doc, "start_document:::start:<xmp>::text:<foo>:1:end:</xmp>::text:x::start:<plaintext>::text:<foo>
24 </plaintext>
25 foo
26 :1:end_document::");
27
28 @a = ();
29 $p->closing_plaintext('yep, emulate gecko');
30 $p->parse(<<EOT)->eof;
31 <plaintext><foo>
32 </plaintext>foo<b></b>
33 EOT
34
35 for (@a) {
36     $_ = "" unless defined;
37 }
38
39 $doc = join(":", @a);
40
41 #diag $doc;
42
43 is($doc, "start_document:::start:<plaintext>::text:<foo>
44 :1:end:</plaintext>::text:foo::start:<b>::end:</b>::text:
45 ::end_document::");