The difference that is produced and correct, is the addition of:<br><br> TODO passed: 2<br><br>in the prove output (which is triggered by the correct addition of "# TODO ..." in the perl output).<br><br>Tye<br>
<br><div class="gmail_quote">On Mon, Dec 29, 2008 at 2:29 PM, Michael R. Wolf <span dir="ltr"><<a href="mailto:MichaelRWolf@att.net">MichaelRWolf@att.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Sorry, all. In my attempt to keep my original posting short, I must have been too cryptic because I had already tried everything that got suggested. (Thanks for the replies. Sorry for misleading you).<br>
<br>
Let me try again.<br>
<br>
I cannot trigger the documented behavior of a TODO block within Test::More using ok(). To test this, I have created two files. Contrary to my understanding of the documentation (perldoc Test::More), I cannot get the two files to behave differently, either with perl(1) or prove(1). Here is a complete listing of the files, and the output.<br>
<br>
I get an "ok" on the second test, regardless of perl/prove or inside/outside a TODO block. (I *did* notice that the *comment* was different, but if it doesn't trigger a different *response* that's testable, so what?)<br>
<br>
I get a 0 return code (indicating success) in all 4 runs (2 files * 2 runs (1 each for perl(1) and prove(1)). I was expecting that the "success" in a TODO would "report it as an unexpected success". No dice.<br>
<br>
Ideas?<br>
<br>
Is TODO broken?<br>
<br>
Has anyone really used TODO, and gotten the documented behavior? (I'm seeming to remember a message from Schwern (a few years ago) that TODO doesn't really work.)<br>
<br>
Thanks (and again, sorry for the too-short previous posting)<br>
Michael<br>
<br>
$ nl -ba t_m_trivial.t<br>
1 #! /usr/bin/perl<br>
2 <br>
3 use Test::More tests => 2;<br>
4 <br>
5 ok(1, 'normal true value 1');<br>
6 <br>
7 ok(2, 'normal true value 2');<br>
$ nl -ba t_m_trivial_w_todo.t<br>
1 #! /usr/bin/perl<br>
2 <br>
3 use Test::More tests => 2;<br>
4 <br>
5 ok(1, 'normal true value 1');<br>
6 <br>
7 TODO: {<br>
8 local $TODO = 'understand $Test::More::TODO';<br>
9 ok(2, 'normal true value 2 inside a TODO block');<br>
10 }<br>
$ perl t_m_trivial.t; echo $?<br>
1..2<br>
ok 1 - normal true value 1<br>
ok 2 - normal true value 2<br>
0<br>
$ prove t_m_trivial.t; echo $?<br>
t_m_trivial....ok<br>
All tests successful.<br>
Files=1, Tests=2, 0 wallclock secs ( 0.03 usr 0.00 sys + 0.02 cusr 0.00 csys = 0.05 CPU)<br>
Result: PASS<br>
0<br>
$ perl t_m_trivial_w_todo.t; echo $?<br>
1..2<br>
ok 1 - normal true value 1<br>
ok 2 - normal true value 2 inside a TODO block # TODO understand $Test::More::TODO<br>
0<br>
$ prove t_m_trivial_w_todo.t; echo $?<br>
t_m_trivial_w_todo....ok<br>
All tests successful.<br>
<br>
Test Summary Report<br>
-------------------<br>
t_m_trivial_w_todo (Wstat: 0 Tests: 2 Failed: 0)<br>
TODO passed: 2<br>
Files=1, Tests=2, 0 wallclock secs ( 0.02 usr 0.00 sys + 0.02 cusr 0.00 csys = 0.04 CPU)<br>
Result: PASS<br>
0<br>
$ WTF?<br>
bash: WTF?: command not found<br>
$<br>
<br>
<br>
<br>
Michael R. Wolf<br>
All mammals learn by playing!<br>
<a href="mailto:MichaelRWolf@att.net" target="_blank">MichaelRWolf@att.net</a><br>
<br>
<br>
<br>
_____________________________________________________________<br>
Seattle Perl Users Group Mailing List<br>
POST TO: <a href="mailto:spug-list@pm.org" target="_blank">spug-list@pm.org</a><br>
SUBSCRIPTION: <a href="http://mail.pm.org/mailman/listinfo/spug-list" target="_blank">http://mail.pm.org/mailman/listinfo/spug-list</a><br>
MEETINGS: 3rd Tuesdays<br>
WEB PAGE: <a href="http://seattleperl.org/" target="_blank">http://seattleperl.org/</a><br>
</blockquote></div><br>