Skip to content

Commit

Permalink
lib/DB.t no strict 'refs' when needed
Browse files Browse the repository at this point in the history
  • Loading branch information
atoomic committed Jul 1, 2020
1 parent 900acb2 commit 067040e
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lib/DB.t
Expand Up @@ -214,6 +214,7 @@ SKIP: {
my $db = DB->loadfile($file);
like( $db, qr!$file\z!, '... should find loaded file from partial name');

no strict 'refs';
is( *DB::dbline, *{ "_<$db" } ,
'... should set *DB::dbline to associated glob');
is( $DB::filename, $db, '... should set $DB::filename to file name' );
Expand All @@ -226,7 +227,9 @@ SKIP: {
use vars qw( *baz );

local $DB::filename = 'baz';
no strict 'refs';
local *baz = *{ "main::_<baz" };
use strict 'refs';

@baz = map { dualvar(1, $_) } qw( one two three four five );
%baz = (
Expand Down Expand Up @@ -310,7 +313,9 @@ SKIP: {
# test DB::_find_subline()
{
my @foo;
no strict 'refs';
local *{ "::_<foo" } = \@foo;
use strict 'refs';

local $DB::package;
local %DB::sub = (
Expand Down Expand Up @@ -357,7 +362,9 @@ SKIP: {
is( $DB::dbline{3}, "\0\0\0abc", '... should remove break, leaving action');
is( $DB::dbline{4}, "\0\0\0abc", '... should not remove set actions' );

no strict 'refs';
local *{ "::_<foo" } = [ 0, 0, 0, 1 ];
use strict 'refs';

local $DB::package;
local %DB::sub = (
Expand Down Expand Up @@ -435,7 +442,9 @@ SKIP: {
is( $DB::dbline{3}, "123", '... should remove action, leaving break');
is( $DB::dbline{4}, "abc\0", '... should not remove set breaks' );

no strict 'refs';
local *{ "::_<foo" } = [ 0, 0, 0, 1 ];
use strict 'refs';

local $DB::package;
local %DB::sub = (
Expand Down

0 comments on commit 067040e

Please sign in to comment.