File: clonei.t

package info (click to toggle)
libhtml-tree-perl 3.23-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 488 kB
  • ctags: 144
  • sloc: perl: 3,555; makefile: 40
file content (19 lines) | stat: -rw-r--r-- 504 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!perl -Tw

use strict;
use Test::More tests => 4;
BEGIN {use_ok ( "HTML::TreeBuilder");}

my $t = HTML::TreeBuilder->new;
$t->parse('stuff <em name="foo">lalal</em>');
$t->eof;
my $c = $t->clone();

#these are correct tests. Of what, I'm not sure.
ok($c->same_as($t), "\$c is the same as \$t, according to HTML::Element");
ok($t->same_as($c), "\$t is the same as \$c, according to HTML::Element");

$c->delete();
ok ($t->find_by_attribute('name', 'foo'), "My name is foo after delete" );

$t->delete();