Skip to content

Commit

Permalink
skip a failing test in perl < 5.12
Browse files Browse the repository at this point in the history
  • Loading branch information
mirod committed Feb 26, 2014
1 parent 777cc41 commit 8044852
Showing 1 changed file with 21 additions and 19 deletions.
40 changes: 21 additions & 19 deletions t/xmlxpath_31vars.t
Expand Up @@ -48,11 +48,13 @@ my( $employees, $areas)= do { local $/="\n\n"; <DATA>; };
is( results( @nodes), 'e3:e4', '2 docs, var is a litteral');
}

{ $te->set_var( E => $te->find( '/employees/employee[@salary>10000]'));
$te->set_var( A => $ta->find( '/areas/area[district="Brooklyn"]/street'));
my @nodes = $te->findnodes('$E[work_area/street = $A]/name');
is( results( @nodes), 'e3:e4', '2 docs, var is a node set');
}
SKIP:
{ skip "node sets in an XPath variable are not supported with perl < 5.12", 1 unless $] >= 5.012;
$te->set_var( E => $te->find( '/employees/employee[@salary>10000]'));
$te->set_var( A => $ta->find( '/areas/area[district="Brooklyn"]/street'));
my @nodes = $te->findnodes('$E[work_area/street = $A]/name');
is( results( @nodes), 'e3:e4', '2 docs, var is a node set');
}

{ $te->set_var( org => 'A');
my @nodes= $te->findnodes('/employees/employee[@org=$org]/name');
Expand All @@ -71,42 +73,42 @@ sub results
{ return join ':', map { $_->id || 'XX' } @_; }

__DATA__
<employees>
<employee salary="11000">
<employees id="e">
<employee salary="11000" id="s1">
<name id="e1">Employee 1</name>
<work_area>
<street>Fifth Avenue</street>
<work_area id="w1">
<street id="st1">Fifth Avenue</street>
</work_area>
</employee>
<employee salary="9000">
<employee salary="9000" id="s2">
<name id="e2">Employee 2</name>
<work_area>
<work_area id="w2">
<street>Abbey Court</street>
</work_area>
</employee>
<employee salary="12000">
<employee salary="12000" id="s3">
<name id="e3">Employee 3</name>
<work_area>
<work_area id="w3">
<street>Abbey Court</street>
</work_area>
</employee>
<employee salary="12000">
<employee salary="12000" id="s4">
<name id="e4">Employee 4</name>
<work_area>
<work_area id="w4">
<street>Broad Street</street>
<street>Abbey Court</street>
</work_area>
</employee>
<employee salary="1000" org="A">
<employee salary="1000" org="A" id="s5">
<name id="e5">Employee 5</name>
<work_area>
<work_area id="w5">
<street>Broad Street</street>
<street>Abbey Court</street>
</work_area>
</employee>
<employee salary="1000" org="A/B">
<employee salary="1000" org="A/B" id="s6">
<name id="e6">Employee 6</name>
<work_area>
<work_area id="w6">
<street>Broad Street</street>
<street>Abbey Court</street>
</work_area>
Expand Down

0 comments on commit 8044852

Please sign in to comment.