Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

don't use vars, use our #1010

Merged
merged 1 commit into from
Dec 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions lib/Test/Builder/IO/Scalar.pm
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,15 @@ modify it under the same terms as Perl itself.

use Carp;
use strict;
use vars qw($VERSION @ISA);
use IO::Handle;

use 5.005;

### The package version, both in 1.23 style *and* usable by MakeMaker:
$VERSION = "2.114";
our $VERSION = "2.114";

### Inheritance:
@ISA = qw(IO::Handle);
our @ISA = qw(IO::Handle);

#==============================

Expand Down
6 changes: 2 additions & 4 deletions lib/Test/Tester.pm
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,10 @@ use Test::Tester::Delegate;

require Exporter;

use vars qw( @ISA @EXPORT );

our $VERSION = '1.302205';

@EXPORT = qw( run_tests check_tests check_test cmp_results show_space );
@ISA = qw( Exporter );
our @EXPORT = qw( run_tests check_tests check_test cmp_results show_space );
our @ISA = qw( Exporter );

my $Test = Test::Builder->new;
my $Capture = Test::Tester::Capture->new;
Expand Down
3 changes: 1 addition & 2 deletions lib/Test/Tester/Capture.pm
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ our $VERSION = '1.302205';

use Test::Builder;

use vars qw( @ISA );
@ISA = qw( Test::Builder );
our @ISA = qw( Test::Builder );

# Make Test::Tester::Capture thread-safe for ithreads.
BEGIN {
Expand Down
4 changes: 1 addition & 3 deletions lib/Test/Tester/Delegate.pm
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ our $VERSION = '1.302205';

use Scalar::Util();

use vars '$AUTOLOAD';

sub new
{
my $pkg = shift;
Expand All @@ -21,7 +19,7 @@ sub new

sub AUTOLOAD
{
my ($sub) = $AUTOLOAD =~ /.*::(.*?)$/;
my ($sub) = our $AUTOLOAD =~ /.*::(.*?)$/;

return if $sub eq "DESTROY";

Expand Down
3 changes: 1 addition & 2 deletions lib/Test2/EventFacet/Meta.pm
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ use warnings;
our $VERSION = '1.302205';

BEGIN { require Test2::EventFacet; our @ISA = qw(Test2::EventFacet) }
use vars qw/$AUTOLOAD/;

# replace set_details
{
Expand Down Expand Up @@ -35,7 +34,7 @@ sub can {
}

sub AUTOLOAD {
my $name = $AUTOLOAD;
my $name = our $AUTOLOAD;
$name =~ s/^.*:://g;
my $sub = $_[0]->can($name);
goto &$sub;
Expand Down
2 changes: 1 addition & 1 deletion lib/Test2/Tools/Spec.pm
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use Test2::Workflow::Task::Group();
use Test2::Tools::Mock();
use Test2::Util::Importer();

use vars qw/@EXPORT @EXPORT_OK/;
our (@EXPORT, @EXPORT_OK);
push @EXPORT => qw{describe cases};
push @EXPORT_OK => qw{include_workflow include_workflows spec_defaults};

Expand Down
5 changes: 2 additions & 3 deletions t/lib/SmallTest.pm
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@ package SmallTest;

require Exporter;

use vars qw( @ISA @EXPORT );
@ISA = qw( Exporter );
@EXPORT = qw( ok is_eq is_num );
our @ISA = qw( Exporter );
our @EXPORT = qw( ok is_eq is_num );

use Test::Builder;

Expand Down
2 changes: 1 addition & 1 deletion t/modules/Plugin/Times.t
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use Test2::API qw/intercept context/;

use Test2::Tools::Defer qw/def do_def/;

use vars qw/@CALLBACKS/;
our @CALLBACKS;

BEGIN {
no warnings 'redefine';
Expand Down
4 changes: 1 addition & 3 deletions t/regression/todo_and_facets.t
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ BEGIN {
*bas_ok = \&Test2::Tools::Basic::ok;
}

use vars qw/$TODO/;

sub leg_ok($;$@) {
my ($bool, $name, @diag);
my $ctx = context();
Expand All @@ -33,7 +31,7 @@ sub new_ok($;$@) {
}

{
local $TODO = "Testing TODO";
local our $TODO = "Testing TODO";

tm_ok(0, "tm_ok fail");
tm_fail('tm_fail');
Expand Down
Loading