File: 102_MKDoc_XML_Tokenizer_Attributes.t

package info (click to toggle)
libmkdoc-xml-perl 0.75-6
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 404 kB
  • sloc: perl: 2,629; xml: 17; makefile: 2
file content (42 lines) | stat: -rw-r--r-- 962 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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/usr/bin/perl
use lib qw (../lib lib);
use Test::More 'no_plan';
use strict;
use warnings;
use MKDoc::XML::Tokenizer;
use Data::Dumper;

my $data = qq|<foo bar"baz">Hello</foo>|;
eval { Dumper (MKDoc::XML::Tokenizer->process_data ($data)) };
ok ($@);

$data = qq |<p foo=bar>|;
eval { Dumper (MKDoc::XML::Tokenizer->process_data ($data)) };
ok ($@);

$data = qq |<p foo="bar">hello world</p>|;
eval { Dumper (MKDoc::XML::Tokenizer->process_data ($data)) };
ok (!$@);


$data = qq |<p foo='bar'>hello world</p>|;
eval { Dumper (MKDoc::XML::Tokenizer->process_data ($data)) };
ok (!$@);

$data = qq |<p foobar>hello world</p>|;
eval { print Dumper (MKDoc::XML::Tokenizer->process_data ($data)) };
ok ($@);

$data = qq |<p foo bar>hello world</p>|;
eval { print Dumper (MKDoc::XML::Tokenizer->process_data ($data)) };
ok ($@);

$data = qq |<p "foobar">hello world</p>|;
eval { print Dumper (MKDoc::XML::Tokenizer->process_data ($data)) };
ok ($@);


1;


__END__