Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical

Re: TODO blocks for Test::XML, and in general

by MidLifeXis (Monsignor)
on Sep 04, 2012 at 17:15 UTC ( #991660=note: print w/replies, xml ) Need Help??

in reply to TODO blocks for Test::XML, and in general

Can you add the actual output and what you expect the output to be? For example, on my machine, I get:

#$ perl -MTest::More -e 'plan "no_plan";TODO:{local $TODO="foo bar"; f +ail("blog");}' not ok 1 - blog # TODO foo bar # Failed (TODO) test 'blog' # at -e line 1. 1..1

This is a valid TODO test (and a harness would mark the test suite as passed, even though it looks like it has failed). I don't have Test::XML::XPath installed, so just in case this is more of a case of improper expectations, pasting what you are seeing might help.


Replies are listed 'Best First'.
Re^2: TODO blocks for Test::XML, and in general
by nglenn (Beadle) on Sep 04, 2012 at 17:31 UTC
    I updated it. Running with prove shows that the test causes the entire test suite to fail.

      Stupid question, but does my snippet above emit a TODO test?

      I also rebuilt the like_xpath routine after removing the lines making use of the XPath parser (see below). What output do you get from it?

      use strict; use warnings; use Carp; use Test::More; use Test::Builder; sub like_xpath { my ($input, $statement, $test_name) = @_; die "usage: like_xpath(xml,xpath[,name])" unless $input && $statement; my $Test = Test::Builder->new; my $ok = eval { # Hardcode a failure return 0; }; if ($@) { $Test->ok( 0, $test_name ); $Test->diag( " Parse Failure: $@" ); return 0; } else { ok( $ok, $test_name ); unless ( $ok ) { diag ( " input: $input" ); diag ( " does not match: $statement" ); } return $ok; } } plan tests=>1; TODO: { local $TODO = 'testing todo block'; like_xpath('<xml-bad/>', '/xml', 'test test'); }


        Your snippet and your edited version both result in TODO tests, and a passing grade for the test suite. Don't know why...

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://991660]
[perldigious]: Mine too thezip, especially my German Shepherd. He looks like he is about to die of heat exhaustion all summer, so he goes nuts when winter comes and he can play in the snow.
[stevieb]: my main off-road vehicle nowadays is a strengthened mercedes ML320. I'm very hard on it, but I've never had any real issues at all (I love how small and light it is, and it has a very, very good centre of gravity for how I roll)
[perldigious]: "for how I roll"... ahhh, I see what you did there stevieb.

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (13)
As of 2016-12-06 16:54 GMT
Find Nodes?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:

    Results (112 votes). Check out past polls.