Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Catalyst: Dev

diag, not warn

 

 

Catalyst dev RSS feed   Index | Next | Previous | View Threaded


david at kineticode

Aug 5, 2008, 11:47 AM

Post #1 of 7 (1182 views)
Permalink
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[at]lists.scsys.co.uk
http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst-dev


dbix-class at trout

Aug 7, 2008, 6:47 PM

Post #2 of 7 (1101 views)
Permalink
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[at]lists.scsys.co.uk
http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst-dev


david at kineticode

Aug 7, 2008, 8:54 PM

Post #3 of 7 (1100 views)
Permalink
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[at]lists.scsys.co.uk
http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst-dev


jon at jrock

Aug 10, 2008, 12:51 PM

Post #4 of 7 (1092 views)
Permalink
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[at]lists.scsys.co.uk
http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst-dev


david at kineticode

Aug 10, 2008, 8:50 PM

Post #5 of 7 (1088 views)
Permalink
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[at]lists.scsys.co.uk
http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst-dev


apv at sedition

Aug 10, 2008, 9:25 PM

Post #6 of 7 (1088 views)
Permalink
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[at]lists.scsys.co.uk
http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst-dev


david at kineticode

Aug 11, 2008, 9:57 AM

Post #7 of 7 (1083 views)
Permalink
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[at]lists.scsys.co.uk
http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst-dev

Catalyst dev RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.