TB2::DebugOnFail - Enter the debugger on failure
use TB2::DebugOnFail; use Test::Simple tests => 3; ok(1); ok(0); # if run with -d you will enter the debugger ok(1);
A demonstration of writing an EventWatcher using accept_result to drop you into the debugger when an assert fails.
accept_result
You have to run the test in the debugger.
You'll wind up at the end of the DebugOnFail assert_end wrapper. You can hit 'r' a few times to get back to your test, or examine the $result object. It would be nice if it could start the debugger just after the assert was called instead.
Test::Builder2::EventWatcher
To install Test::Simple, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Test::Simple
CPAN shell
perl -MCPAN -e shell install Test::Simple
For more information on module installation, please visit the detailed CPAN module installation guide.