File: cleanup.t

package info (click to toggle)
libxml-xpath-perl 1.48-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 608 kB
  • sloc: perl: 4,444; xml: 34; makefile: 10
file content (27 lines) | stat: -rw-r--r-- 577 bytes parent folder | download
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
#!/usr/bin/perl

use strict;
use warnings;

use constant HAS_LEAKTRACE => eval{ require Test::LeakTrace };
use Test::More HAS_LEAKTRACE ? (tests => 1) : (skip_all => 'require Test::LeakTrace');
use Test::LeakTrace;

use XML::XPath;
use XML::XPath::XMLParser;
$XML::XPath::SafeMode = 1;

my $data = join '', <DATA>;
no_leaks_ok{
    my $xp = XML::XPath->new(xml => $data);
    my ($root) = $xp->findnodes('/');
    $xp->cleanup;
}

__DATA__
<Shop id="mod3838" hello="you">
<Cart id="1" crap="crap">
        <Item id="11" crap="crap"/>
</Cart>
<Cart id="2" crap="crap"/>
</Shop>