File: 04_new_methods.t

package info (click to toggle)
libhtml-treebuilder-libxml-perl 0.28-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 264 kB
  • sloc: perl: 533; makefile: 2; sh: 1
file content (16 lines) | stat: -rw-r--r-- 359 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use strict;
use warnings;
use Test::More;
use HTML::TreeBuilder::LibXML;

plan tests => 2;

{
    my $root = HTML::TreeBuilder::LibXML->new_from_content("<html><body>", "<p>foo</p>", "</body></html>");
    is $root->findvalue("//p"), "foo";
}

{
    my $root = HTML::TreeBuilder::LibXML->new_from_file("t/test.html");
    is $root->findvalue("//p"), "bar";
}