Devel::TestEmbed - extend the debugger with Test::More
# We assume that the supplied perldb.sample has been # copied to the appropriate place. $ perl -demo Loading DB routines from perl5db.pl version 1.27 Editor support available. Enter h or `h h' for help, or `man perldebug' for more help. main::(-e:1): mo auto(-1) DB<1> use Test::More qw(no_plan) DB<2> use_ok("CGI"); DB<3> $obj = new CGI; DB<4> # Keep 'new CGI' in our test DB<5> isa_ok($obj, "CGI") ok 2 - The object isa CGI DB<6> tdump "our.t" Recording tests for this session in our.t ... done (2 tests). DB<7> q 1..2 $ cat our.t use Test::More tests=>2; use_ok("CGI"); # Keep 'new CGI' in our test $obj = new CGI; isa_ok($obj, "CGI");
The Devel::TestEmbed module loads Test::More for you, allowing you to use its functions to test code; you may then save the tests you used in this debugger session via the tdump function.
Devel::TestEmbed
Test::More
tdump
If needed, you may save "setup" code in the test as well by entering a comment at the debugger prompt after each line of such code.
The module defines an afterinit and watchfunction; you will need to take this into account if you wish to defined either of these yourself while using this function. See perldoc perl5db.pl for more informaton on these routines.
afterinit
watchfunction
perldoc perl5db.pl
Package switching is not captured at the moment.
Joe McMahon <mcmahon@perl.com>.
1 POD Error
The following errors were encountered while parsing the POD:
=cut found outside a pod block. Skipping to next block.
To install Devel::Command::Tdump, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Devel::Command::Tdump
CPAN shell
perl -MCPAN -e shell install Devel::Command::Tdump
For more information on module installation, please visit the detailed CPAN module installation guide.