Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Test-Simple CPAN distribution.

Report information
The Basics
Id: 14233
Status: resolved
Priority: 0/
Queue: Test-Simple

People
Owner: Nobody in particular
Requestors: nadim [...] khemir.net
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: (no value)
Fixed in: (no value)



Subject: Add debugging possibility to tests
Hi, I very often find myself adding and removing debugging code from my tests . Here is a little example: is_deeply(DoSomething(...), 'expected', 'message'); is often written like this: my $result = DoSomething(..); is_deeply(DoSomething(...), 'expected', 'message'); if(Compare($result, 'expected')
Hi, I very often find myself adding and removing debugging code from my tests . Here is a little example: is_deeply(DoSomething(...), 'expected', 'message'); is often written like this: my $result = DoSomething(..); is_deeply(DoSomething(...), 'expected', 'message'); if(Compare($result, 'expected') # somewhere here, I press tab and retrun which send the first report:( instead for adding a tab. I'd rather write: is_deeply(DoSomething(...), 'expected', 'message', "code to eval, or sub, to run if not OK") ; Cheers, Nadim.
[NKH - Fri Aug 19 06:19:15 2005]: Show quoted text
> I'd rather write: > is_deeply(DoSomething(...), 'expected', 'message', "code to eval, or > sub, to run if not OK") ;
All test functions return true when the passes, false if they fail. is_deeply( DoSomething(...), 'expected', 'message' ) or sub_to_run_if_not_ok; Generally one uses diag() to express further diagnostics such as: ok( open FH, $file ) or diag("Can't open $file: $!"); PS This is not the proper queue for Test::More bugs. The proper queue is Test-Simple.