Welcome to the Monastery | |
PerlMonks |
Re^4: Get the number of the current test when debugging a test scriptby Dumu (Monk) |
on Jul 01, 2015 at 09:47 UTC ( [id://1132780]=note: print w/replies, xml ) | Need Help?? |
I like the debugger: it allows you to break, then perform multiple test examining variables, data structures etc. without getting mixed up in all of your program's other output. Also, you don't have to mess up your source code with print statements. I do use print, say, Data::Printer, Data::Dumper etc. as well. The debugger allows you to do all that but wtih more flexibility, as well as trace code execution, of course. It's like fast-forwarding through a movie instead of taking a photograph - in a way. If you want the debugger to stop at a place in the source code, you can just type:
This puts a breakpoint in the Perl code. You can then just type 'c' at the DB prompt to zoom straight there. UpdateAnd to answer your question properly, I do use test comments. But test comments need not be unique (they may not be if you're running someone else's tests, even if yours are) and are often similiar to other test comments. I caught sight of the test number after which the bug was occurring in the test output, and I wanted to know how to go straight there with the debugger. That's all.
In Section
Seekers of Perl Wisdom
|
|