Skip to content

Commit

Permalink
Add @db::clients as a global. Use like() in testing instaead of cmp_o…
Browse files Browse the repository at this point in the history
…k(..., /.../, '>', 0)
  • Loading branch information
Rocky Bernstein committed Jan 7, 2012
1 parent 4224bbf commit 2c173ce
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
5 changes: 3 additions & 2 deletions lib/Devel/Trepan/DB.pm
Expand Up @@ -12,7 +12,7 @@ use English qw( -no_match_vars );

use vars qw($usrctxt $running $caller
$event @ret $ret $return_value @return_value
$stop
$stop @clients
$init_dollar0 $OS_STARTUP_DIR);

use Devel::Trepan::DB::Backtrace;
Expand All @@ -21,7 +21,7 @@ use Devel::Trepan::DB::Eval;
use Devel::Trepan::DB::Sub;

# "private" globals
my ($ready, $deep, @saved, @skippkg, @clients);
my ($ready, $deep, @saved, @skippkg);

my $ineval = {};

Expand Down Expand Up @@ -52,6 +52,7 @@ BEGIN {
@DB::args = (); # arguments of current subroutine or @ARGV array
@DB::dbline = (); # list of lines in currently loaded file
%DB::dbline = (); # actions in current file (keyed by line number)
@DB::clients = ();

# other "public" globals

Expand Down
7 changes: 3 additions & 4 deletions t/20test-trepanpl-opts.t
Expand Up @@ -34,8 +34,7 @@ if ($pid) {
is(1, $CHILD_ERROR >> 8);
open($fh, '<', $tempfile);
$output = <$fh>; # read whole file
cmp_ok($output =~ /Usage:/, '>', 0,
"$trepanpl --help should have a 'usage line");
like($output, qr/Usage:/, "$trepanpl --help should have a 'usage line");
} else {
my $output = `$EXECUTABLE_NAME -- $trepanpl --help`;
my $rc = $? >> 8;
Expand All @@ -50,8 +49,8 @@ if ($pid) {
is($CHILD_ERROR >> 8, 10);
open($fh, '<', $tempfile);
$output = <$fh>; # read whole file
cmp_ok($output =~ /, version /, '>', 0,
"$trepanpl --version should be able to show the version number");
like($output, qr/, version /,
"$trepanpl --version should be able to show the version number");
} else {
my $output = `$EXECUTABLE_NAME -- $trepanpl --version`;
my $rc = $? >> 8;
Expand Down

0 comments on commit 2c173ce

Please sign in to comment.