File: 03_parsefile.t

package info (click to toggle)
libxml-treepp-perl 0.43-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 680 kB
  • sloc: perl: 810; xml: 58; sh: 41; makefile: 2
file content (16 lines) | stat: -rwxr-xr-x 680 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# ----------------------------------------------------------------
    use strict;
    use Test::More tests => 3;
    BEGIN { use_ok('XML::TreePP') };
# ----------------------------------------------------------------
    my $tpp = XML::TreePP->new();
    my $tree = $tpp->parsefile( 't/example/index.rdf' );

    my $title = $tree->{'rdf:RDF'}->{channel}->{title};
    like( $title, qr{ kawa.net }ix, '<title>' );

    my $about = $tree->{'rdf:RDF'}->{channel}->{'-rdf:about'};
    like( $about, qr{ ^http:// }x, '<channel rdf:about="">' );
# ----------------------------------------------------------------
;1;
# ----------------------------------------------------------------