File: html-tree.pl

package info (click to toggle)
libtest-weaken-perl 3.022000-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 372 kB
  • sloc: perl: 3,828; makefile: 24; sh: 6
file content (32 lines) | stat: -rw-r--r-- 617 bytes parent folder | download | duplicates (3)
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
#!/usr/bin/perl -w
use strict;
use Test::Weaken;

# new HTML::Element doesn't need delete, -noweak asks for old behaviour
use HTML::TreeBuilder '-noweak';

# uncomment this to run the ### lines
use Smart::Comments;

my $tw = Test::Weaken::leaks
  ({ constructor => sub {
       ### constructor ...
       my $tree = HTML::TreeBuilder->new_from_content
         ('
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html lang="en">
<head>
<title>A Web Page</title>
</head>
<body>
Blah
</body>
</html>
');
       # ### $tree
       return $tree;
     },
     destructor_method => 'delete',
   });
### $tw