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
|