File: 46err_column.t

package info (click to toggle)
libxml-libxml-perl 2.0207%2Bdfsg%2Breally%2B2.0134-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 2,572 kB
  • sloc: perl: 6,310; ansic: 3,851; xml: 182; sh: 21; makefile: 16
file content (40 lines) | stat: -rw-r--r-- 1,001 bytes parent folder | download | duplicates (8)
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
33
34
35
36
37
38
39
40
#!/usr/bin/perl

use strict;
use warnings;

# Bug #66642 for XML-LibXML: $err->column() incorrectly maxed out as 80
# https://rt.cpan.org/Public/Bug/Display.html?id=66642 .

use Test::More tests => 1;

use XML::LibXML qw();

eval {
    XML::LibXML->new()->parse_string(
'<foo attr1="value1" attr2="value2" attr3="value2" attr4="value2"'
. ' attr5="value2" attr6="value2" attr7="value2" attr8="value2"'
. ' attr9="value2" attr10="value2" attr11="value2" attr12="value2"'
. ' attr13="value2"attr14="value2" attr15="value2" />'
    )
};

SKIP:
{
    my $err = $@;
    # This is a fix for:
    # https://rt.cpan.org/Ticket/Display.html?id=69070
    # << t/46err_column.t is broken on centos/RHEL 4 >>

    # On this system, libxml is as follows:
    # libxml2-devel-2.6.16-12.8

    if (! ref($err))
    {
        skip('parse_string returned a string - not an XML::LibXML::Error object - probably an old libxml2',
            1
        );
    }
    # TEST
    is ($err->column(), 203, "Column is OK.");
}