File: 03_parsefile.t

package info (click to toggle)
libxml-treepp-perl 0.39-1
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd, squeeze, wheezy
  • size: 612 kB
  • ctags: 43
  • sloc: perl: 795; xml: 58; makefile: 45; sh: 37
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;
# ----------------------------------------------------------------