#!./perl -Tw
BEGIN {
chdir 't' if -d 't';
}
# symbolic references used later
# @DB::dbline values have both integer and string components (Benjamin Goldberg)
# must happen at compile time for DB:: package variable localizations to work
BEGIN {
}
# test DB::sub()
{
my $callflag = 0;
local $DB::sub = sub {
$callflag += shift || 1;
return @vals;
};
DB::sub;
}
# test DB::DB()
{
'DB::DB() should return undef if $DB::ready is false');
# change packages to mess with caller()
# stops at line 94
}
# test DB::save()
{
# assigning a number to $! seems to produce an error message, when read
local ($@, $,, $/, $\, $^W, $!) = (1 .. 5);
}
# test DB::catch()
{
# add clients and test to see if they are awakened
}
# test DB::_clientname()
'DB::_clientname should return refname');
'DB::_clientname should not return non refname');
# test DB::next() and DB::step()
{
}
# test DB::cont()
{
# cannot test @stack
}
# test DB::ret()
{
# cannot test @stack
}
# test DB::backtrace()
{
'... should find eval STRING construct');
like( $ret[0], qr/\$ = &main::check_context/,
'... should respect context of calling construct');
# does not check 'require' or @DB::args mangling
}
sub check_context {
return (eval "one($_[0])")[-1];
}
# test DB::trace_toggle
{
}
# test DB::subs()
{
local %DB::sub;
}
# test DB::filesubs()
{
}
# test DB::files()
{
}
# test DB::lines()
{
}
# test DB::loadfile()
SKIP: {
'DB::loadfile() should not find unloaded file' );
$file =~ s/^_<..//;
'... should set *DB::dbline to associated glob');
# test clients
}
# test DB::lineevents()
{
%baz = (
1 => "foo\0bar",
3 => "boo\0far",
4 => "fazbaz",
);
# array access in DB::lineevents() starts at element 1, not 0
}
# test DB::set_break()
{
1 => "\0",
2 => undef,
3 => "123\0\0\0abc",
4 => "\0abc",
);
*DB::dbline = [ $dualfalse, $dualtrue, $dualfalse, $dualfalse, $dualtrue ];
local %DB::sub = (
'main::foo' => 'foo:1-4',
);
'... should use $DB::lineno without specified line' );
local %DB::sub = (
'main::foo' => 'foo:1-4',
);
'... should use _find_subline() to resolve subname' );
}
# test DB::set_tbreak()
{
*DB::dbline = [ $dualfalse, $dualtrue, $dualfalse, $dualfalse, $dualtrue ];
local %DB::sub = (
'main::foo' => 'foo:1-4',
);
'... should use _find_subline() to resolve subname' );
}
# test DB::_find_subline()
{
my @foo;
local %DB::sub = (
'TEST::foo' => 'foo:10-15',
'main::foo' => 'foo:11-12',
'bar::bar' => 'foo:10-16',
);
'DB::_find_subline() should find fully qualified sub' );
'... should resolve unqualified package name to main::' );
'... should resolve unqualified name with $DB::package, if defined' );
$foo[11] = $dualfalse;
'... should increment past lines with no events' );
'... should not find nonexistant sub' );
}
# test DB::clr_breaks()
{
my %lines = (
1 => "\0",
2 => undef,
3 => "123\0\0\0abc",
4 => "\0\0\0abc",
);
local *{ "::_<foo" } = [ 0, 0, 0, 1 ];
local %DB::sub = (
'main::foo' => 'foo:1-3',
);
'... should find lines via _find_subline()' );
'... should output warning if sub cannot be found');
'Relying on @DB::dbline in DB::clr_breaks() should clear breaks' );
'... should only go to last index of @DB::dbline' );
}
# test DB::set_action()
{
2 => "\0abc",
);
*DB::dbline = [ $dualfalse, $dualfalse, $dualtrue, $dualtrue ];
'DB::set_action() should replace existing action' );
'... should output warning if sub cannot be found');
'... should warn if line cannot be actionivated' );
}
# test DB::clr_actions()
{
my %lines = (
1 => "\0",
2 => undef,
3 => "123\0abc",
4 => "abc\0",
);
local *{ "::_<foo" } = [ 0, 0, 0, 1 ];
local %DB::sub = (
'main::foo' => 'foo:1-3',
);
'... should output warning if sub cannot be found');
'Relying on @DB::dbline in DB::clr_actions() should clear actions' );
'... should only go to last index of @DB::dbline' );
}
# test DB::prestop()
'DB::prestop() should return undef for undef value' );
# test DB::poststop(), not exactly parallel
'DB::prestop() should return undef for undef value' );
# test DB::evalcode()
'DB::evalcode() should return undef for undef value' );
# test DB::_outputall(), must create fake clients first
'DB::_outputall() should call output(@_) on all clients' );
# test virtual methods
}
# DB::skippkg() uses lexical
# DB::ready() uses lexical
sub new {
}
sub set_tbreak {
}
sub output {
my $self = shift;
} else {
}
}