File: test_3_32.t

package info (click to toggle)
libxml-twig-perl 1%3A3.52-3
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 4,952 kB
  • sloc: perl: 21,221; xml: 423; makefile: 9
file content (31 lines) | stat: -rwxr-xr-x 858 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
#!/usr/bin/perl -w
use strict;

use strict;
use Carp;
use File::Spec;
use lib File::Spec->catdir(File::Spec->curdir,"t");
use tools;

$|=1;
my $DEBUG=0;
 
use XML::Twig;

my $TMAX=1;
print "1..$TMAX\n";

if( $] >= 5.008)
  { # test non ascii letters at the beginning of an element name in a selector
    # can't use non ascii chars in script, so the tag name needs to come from the doc!
    my $doc=q{<doc><tag>&#233;t&#233;</tag><elt>summer</elt><elt>estate</elt></doc>};
    my $t= XML::Twig->parse( $doc);
    my $tag= $t->root->first_child( 'tag')->text;
    foreach ($t->root->children( 'elt')) { $_->set_tag( $tag); }
    is( $t->root->first_child( $tag)->text, 'summer', 'non ascii letter to start a name in a condition');
  }
else
  { skip( 1, "known bug in perl $]: tags starting with a non ascii letter cannot be used in expressions"); }

exit;
1;