File: deep_nesting.t

package info (click to toggle)
libxml-parser-perl 2.47-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,396 kB
  • sloc: xml: 3,937; perl: 2,026; makefile: 38; ansic: 27
file content (22 lines) | stat: -rw-r--r-- 420 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
BEGIN { print "1..1\n"; }

# Test for deeply nested elements to exercise st_serial_stack reallocation.
# This catches off-by-one errors in the stack growth check (GH #39).

use XML::Parser;

my $depth = 600;

my $xml = '';
for my $i (1 .. $depth) {
    $xml .= "<e$i>";
}
for my $i (reverse 1 .. $depth) {
    $xml .= "</e$i>";
}

my $p = XML::Parser->new;
eval { $p->parse($xml) };

print "not " if $@;
print "ok 1\n";