Mailing List Archive

diag, not warn
Suggested patch for Catalyst::Manual::Tutorial::Testing:

Index: lib/Catalyst/Manual/Tutorial/Testing.pod
===================================================================
--- lib/Catalyst/Manual/Tutorial/Testing.pod (revision 8176)
+++ lib/Catalyst/Manual/Tutorial/Testing.pod (working copy)
@@ -314,7 +314,7 @@
temporarily insert a line similar to the following right after the
failed test:

- warn $ua1->content;
+ diag $ua1->content;

This will cause the full HTML returned by the request to be displayed.

Best,

David

_______________________________________________
Catalyst-dev mailing list
Catalyst-dev@lists.scsys.co.uk
http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst-dev
Re: diag, not warn [ In reply to ]
On Tue, Aug 05, 2008 at 11:47:07AM -0700, David E. Wheeler wrote:
> Suggested patch for Catalyst::Manual::Tutorial::Testing:
>
> Index: lib/Catalyst/Manual/Tutorial/Testing.pod
> ===================================================================
> --- lib/Catalyst/Manual/Tutorial/Testing.pod (revision 8176)
> +++ lib/Catalyst/Manual/Tutorial/Testing.pod (working copy)
> @@ -314,7 +314,7 @@
> temporarily insert a line similar to the following right after the
> failed test:
>
> - warn $ua1->content;
> + diag $ua1->content;
>
> This will cause the full HTML returned by the request to be displayed.

Remind me why this is better?

--
Matt S Trout Need help with your Catalyst or DBIx::Class project?
Technical Director http://www.shadowcat.co.uk/catalyst/
Shadowcat Systems Ltd. Want a managed development or deployment platform?
http://chainsawblues.vox.com/ http://www.shadowcat.co.uk/servers/

_______________________________________________
Catalyst-dev mailing list
Catalyst-dev@lists.scsys.co.uk
http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst-dev
Re: diag, not warn [ In reply to ]
On Aug 7, 2008, at 18:47, Matt S Trout wrote:

>> - warn $ua1->content;
>> + diag $ua1->content;
>>
>> This will cause the full HTML returned by the request to be
>> displayed.
>
> Remind me why this is better?

It prevents the output from fucking up the harness.

Best,

David

_______________________________________________
Catalyst-dev mailing list
Catalyst-dev@lists.scsys.co.uk
http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst-dev
Re: diag, not warn [ In reply to ]
* On Thu, Aug 07 2008, David E. Wheeler wrote:
> On Aug 7, 2008, at 18:47, Matt S Trout wrote:
>
>>> - warn $ua1->content;
>>> + diag $ua1->content;
>>>
>>> This will cause the full HTML returned by the request to be
>>> displayed.
>>
>> Remind me why this is better?
>
> It prevents the output from fucking up the harness.

I don't think the harness looks for anything on STDERR.

--
print just => another => perl => hacker => if $,=$"

_______________________________________________
Catalyst-dev mailing list
Catalyst-dev@lists.scsys.co.uk
http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst-dev
Re: diag, not warn [ In reply to ]
On Aug 10, 2008, at 12:51, Jonathan Rockway wrote:

>>> Remind me why this is better?
>>
>> It prevents the output from fucking up the harness.
>
> I don't think the harness looks for anything on STDERR.

`diag` sends stuff to STDERR. So yes, it does.

Best,

David

_______________________________________________
Catalyst-dev mailing list
Catalyst-dev@lists.scsys.co.uk
http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst-dev
Re: diag, not warn [ In reply to ]
On Aug 10, 2008, at 8:50 PM, David E. Wheeler wrote:
> On Aug 10, 2008, at 12:51, Jonathan Rockway wrote:
>>>> Remind me why this is better?
>>>
>>> It prevents the output from fucking up the harness.
>>
>> I don't think the harness looks for anything on STDERR.
>
> `diag` sends stuff to STDERR. So yes, it does.

Is that true? I don't know the suite well but a casual peek at
Test::Builder's guts looks like it goes to STDERR and STDOUT
alternately depending on whether the output was from failure or from
intentional calls. I think the reason it never interferes with test
harness is that the output is escaped/#commented.

-Ashley

_______________________________________________
Catalyst-dev mailing list
Catalyst-dev@lists.scsys.co.uk
http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst-dev
Re: diag, not warn [ In reply to ]
On Aug 10, 2008, at 21:25, Ashley wrote:

> On Aug 10, 2008, at 8:50 PM, David E. Wheeler wrote:
>> On Aug 10, 2008, at 12:51, Jonathan Rockway wrote:
>>>>> Remind me why this is better?
>>>>
>>>> It prevents the output from fucking up the harness.
>>>
>>> I don't think the harness looks for anything on STDERR.
>>
>> `diag` sends stuff to STDERR. So yes, it does.
>
> Is that true? I don't know the suite well but a casual peek at
> Test::Builder's guts looks like it goes to STDERR and STDOUT
> alternately depending on whether the output was from failure or from
> intentional calls. I think the reason it never interferes with test
> harness is that the output is escaped/#commented.

Right. Which is why I suggest `diag` instead of `warn`.

Best,

David


_______________________________________________
Catalyst-dev mailing list
Catalyst-dev@lists.scsys.co.uk
http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst-dev