Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

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

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


in reply to Re^2: TODO blocks for Test::XML, and in general
in thread TODO blocks for Test::XML, and in general

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'); }

--MidLifeXis

Replies are listed 'Best First'.
Re^4: TODO blocks for Test::XML, and in general
by nglenn (Beadle) on Sep 04, 2012 at 19:49 UTC
    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?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://991674]
help
Chatterbox?
[erix]: he caught a hare once (must have been a young one...)
virtualsue uses arcane git commands to resurrect a file, gets it back into shape and quits for the day
[GotToBTru]: a few years ago, when we had 3 dogs, the largest of them caught a chipmunk, but did not know what to do with it other than hold it in his mouth
[GotToBTru]: my wife told him to spit it out, so he did
[erix]: yeah, modern dogs are cute tjhat way :)
[erix]: except of course, the RHODESIAN LION HOUND ! :)
[Discipulus]: in roma cars are good mouser.. fortunnately no mouse at 7th floor..
[GotToBTru]: that's a name that should always be accompanied by a trumper fanfare
[GotToBTru]: trumpet, not trumper
[GotToBTru]: good thing too, Discipulus, no roads on the 7th floor either

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (13)
As of 2017-11-17 20:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:













    Results (272 votes). Check out past polls.

    Notices?