From ebcbdaed99f87b303923638408db594b24c6f4e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C5=8Dan?= Date: Sat, 7 Mar 2026 10:24:17 -0700 Subject: [PATCH] refactor: replace deprecated 'use base' with BEGIN require + @ISA Replace all 78 occurrences of 'use base' in lib/ with the pattern: BEGIN { require Module; our @ISA = qw(Module) } This follows the convention established in Test2::Tools::Tiny and eliminates the dependency on the deprecated base.pm pragma. Changes include both runtime code and POD documentation examples to maintain consistency throughout the codebase. Co-Authored-By: Claude Opus 4.6 --- lib/Test/Builder.pm | 2 +- lib/Test2/API.pm | 2 +- lib/Test2/AsyncSubtest/Event/Attach.pm | 2 +- lib/Test2/AsyncSubtest/Event/Detach.pm | 2 +- lib/Test2/AsyncSubtest/Hub.pm | 2 +- lib/Test2/Bundle.pm | 2 +- lib/Test2/Bundle/More.pm | 2 +- lib/Test2/Bundle/Simple.pm | 2 +- lib/Test2/Compare.pm | 2 +- lib/Test2/Compare/Array.pm | 2 +- lib/Test2/Compare/Bag.pm | 2 +- lib/Test2/Compare/Base.pm | 2 +- lib/Test2/Compare/Bool.pm | 2 +- lib/Test2/Compare/Custom.pm | 2 +- lib/Test2/Compare/DeepRef.pm | 2 +- lib/Test2/Compare/Event.pm | 2 +- lib/Test2/Compare/EventMeta.pm | 2 +- lib/Test2/Compare/Float.pm | 2 +- lib/Test2/Compare/Hash.pm | 2 +- lib/Test2/Compare/Isa.pm | 2 +- lib/Test2/Compare/Meta.pm | 2 +- lib/Test2/Compare/Number.pm | 2 +- lib/Test2/Compare/Object.pm | 2 +- lib/Test2/Compare/OrderedSubset.pm | 2 +- lib/Test2/Compare/Pattern.pm | 2 +- lib/Test2/Compare/Ref.pm | 2 +- lib/Test2/Compare/Regex.pm | 2 +- lib/Test2/Compare/Scalar.pm | 2 +- lib/Test2/Compare/Set.pm | 2 +- lib/Test2/Compare/String.pm | 2 +- lib/Test2/Compare/Undef.pm | 2 +- lib/Test2/Compare/Wildcard.pm | 2 +- lib/Test2/Event.pm | 2 +- lib/Test2/IPC/Driver.pm | 4 ++-- lib/Test2/Manual/Tooling/FirstTool.pm | 2 +- lib/Test2/Manual/Tooling/Formatter.pm | 4 ++-- lib/Test2/Require.pm | 2 +- lib/Test2/Require/AuthorTesting.pm | 2 +- lib/Test2/Require/AutomatedTesting.pm | 2 +- lib/Test2/Require/EnvVar.pm | 2 +- lib/Test2/Require/ExtendedTesting.pm | 2 +- lib/Test2/Require/Fork.pm | 2 +- lib/Test2/Require/Module.pm | 2 +- lib/Test2/Require/NonInteractiveTesting.pm | 2 +- lib/Test2/Require/Perl.pm | 2 +- lib/Test2/Require/RealFork.pm | 2 +- lib/Test2/Require/ReleaseTesting.pm | 2 +- lib/Test2/Tools.pm | 2 +- lib/Test2/Tools/AsyncSubtest.pm | 2 +- lib/Test2/Tools/Basic.pm | 2 +- lib/Test2/Tools/Class.pm | 2 +- lib/Test2/Tools/ClassicCompare.pm | 2 +- lib/Test2/Tools/Compare.pm | 2 +- lib/Test2/Tools/Defer.pm | 2 +- lib/Test2/Tools/Encoding.pm | 2 +- lib/Test2/Tools/Event.pm | 2 +- lib/Test2/Tools/Exception.pm | 2 +- lib/Test2/Tools/Exports.pm | 2 +- lib/Test2/Tools/GenTemp.pm | 2 +- lib/Test2/Tools/Grab.pm | 2 +- lib/Test2/Tools/Mock.pm | 2 +- lib/Test2/Tools/Ref.pm | 2 +- lib/Test2/Tools/Refcount.pm | 2 +- lib/Test2/Tools/Subtest.pm | 2 +- lib/Test2/Tools/Warnings.pm | 2 +- lib/Test2/Util/HashBase.pm | 4 ++-- lib/Test2/Util/Ref.pm | 2 +- lib/Test2/Util/Stash.pm | 2 +- lib/Test2/Util/Sub.pm | 2 +- lib/Test2/Util/Table.pm | 2 +- lib/Test2/Util/Table/Cell.pm | 2 +- lib/Test2/Util/Table/LineBreak.pm | 2 +- lib/Test2/Util/Times.pm | 2 +- lib/Test2/Workflow.pm | 2 +- lib/Test2/Workflow/Build.pm | 2 +- lib/Test2/Workflow/Task.pm | 2 +- lib/Test2/Workflow/Task/Action.pm | 2 +- lib/Test2/Workflow/Task/Group.pm | 2 +- 78 files changed, 81 insertions(+), 81 deletions(-) diff --git a/lib/Test/Builder.pm b/lib/Test/Builder.pm index ff9bf115b..d2964a623 100644 --- a/lib/Test/Builder.pm +++ b/lib/Test/Builder.pm @@ -1813,7 +1813,7 @@ Test::Builder - Backend for building test libraries =head1 SYNOPSIS package My::Test::Module; - use base 'Test::Builder::Module'; + BEGIN { require Test::Builder::Module; our @ISA = qw(Test::Builder::Module) } my $CLASS = __PACKAGE__; diff --git a/lib/Test2/API.pm b/lib/Test2/API.pm index d09a21f9a..689ba5926 100644 --- a/lib/Test2/API.pm +++ b/lib/Test2/API.pm @@ -890,7 +890,7 @@ The C method is your primary interface into the Test2 framework. use Test2::API qw/context/; our @EXPORT = qw/my_ok/; - use base 'Exporter'; + BEGIN { require Exporter; our @ISA = qw(Exporter) } # Just like ok() from Test::More sub my_ok($;$) { diff --git a/lib/Test2/AsyncSubtest/Event/Attach.pm b/lib/Test2/AsyncSubtest/Event/Attach.pm index 498fe9a96..092caaa4f 100644 --- a/lib/Test2/AsyncSubtest/Event/Attach.pm +++ b/lib/Test2/AsyncSubtest/Event/Attach.pm @@ -4,7 +4,7 @@ use warnings; our $VERSION = '1.302220'; -use base 'Test2::Event'; +BEGIN { require Test2::Event; our @ISA = qw(Test2::Event) } use Test2::Util::HashBase qw/id/; sub no_display { 1 } diff --git a/lib/Test2/AsyncSubtest/Event/Detach.pm b/lib/Test2/AsyncSubtest/Event/Detach.pm index 917fb3f69..a64f53242 100644 --- a/lib/Test2/AsyncSubtest/Event/Detach.pm +++ b/lib/Test2/AsyncSubtest/Event/Detach.pm @@ -4,7 +4,7 @@ use warnings; our $VERSION = '1.302220'; -use base 'Test2::Event'; +BEGIN { require Test2::Event; our @ISA = qw(Test2::Event) } use Test2::Util::HashBase qw/id/; sub no_display { 1 } diff --git a/lib/Test2/AsyncSubtest/Hub.pm b/lib/Test2/AsyncSubtest/Hub.pm index 3f0981bb1..a056bb645 100644 --- a/lib/Test2/AsyncSubtest/Hub.pm +++ b/lib/Test2/AsyncSubtest/Hub.pm @@ -4,7 +4,7 @@ use warnings; our $VERSION = '1.302220'; -use base 'Test2::Hub::Subtest'; +BEGIN { require Test2::Hub::Subtest; our @ISA = qw(Test2::Hub::Subtest) } use Test2::Util::HashBase qw/ast_ids ast/; use Test2::Util qw/get_tid/; diff --git a/lib/Test2/Bundle.pm b/lib/Test2/Bundle.pm index 85fec9ff3..8b255db80 100644 --- a/lib/Test2/Bundle.pm +++ b/lib/Test2/Bundle.pm @@ -47,7 +47,7 @@ Writing a bundle can be very simple: # Re-export the tools our @EXPORTS = qw/ok plan done_testing/; - use base 'Exporter'; + BEGIN { require Exporter; our @ISA = qw(Exporter) } 1; diff --git a/lib/Test2/Bundle/More.pm b/lib/Test2/Bundle/More.pm index 654e574aa..c0793c02a 100644 --- a/lib/Test2/Bundle/More.pm +++ b/lib/Test2/Bundle/More.pm @@ -33,7 +33,7 @@ our @EXPORT = qw{ subtest }; -use base 'Exporter'; +BEGIN { require Exporter; our @ISA = qw(Exporter) } 1; diff --git a/lib/Test2/Bundle/Simple.pm b/lib/Test2/Bundle/Simple.pm index 8f84681bd..d6741a505 100644 --- a/lib/Test2/Bundle/Simple.pm +++ b/lib/Test2/Bundle/Simple.pm @@ -9,7 +9,7 @@ use Test2::Plugin::ExitSummary; use Test2::Tools::Basic qw/ok plan done_testing skip_all/; our @EXPORT = qw/ok plan done_testing skip_all/; -use base 'Exporter'; +BEGIN { require Exporter; our @ISA = qw(Exporter) } 1; diff --git a/lib/Test2/Compare.pm b/lib/Test2/Compare.pm index 2774d268a..5ddb2c285 100644 --- a/lib/Test2/Compare.pm +++ b/lib/Test2/Compare.pm @@ -15,7 +15,7 @@ our @EXPORT_OK = qw{ get_build push_build pop_build build strict_convert relaxed_convert convert }; -use base 'Exporter'; +BEGIN { require Exporter; our @ISA = qw(Exporter) } sub compare { my ($got, $check, $convert) = @_; diff --git a/lib/Test2/Compare/Array.pm b/lib/Test2/Compare/Array.pm index 99d6606e6..baa06c867 100644 --- a/lib/Test2/Compare/Array.pm +++ b/lib/Test2/Compare/Array.pm @@ -2,7 +2,7 @@ package Test2::Compare::Array; use strict; use warnings; -use base 'Test2::Compare::Base'; +BEGIN { require Test2::Compare::Base; our @ISA = qw(Test2::Compare::Base) } our $VERSION = '1.302220'; diff --git a/lib/Test2/Compare/Bag.pm b/lib/Test2/Compare/Bag.pm index 82803528a..75a9921fe 100644 --- a/lib/Test2/Compare/Bag.pm +++ b/lib/Test2/Compare/Bag.pm @@ -2,7 +2,7 @@ package Test2::Compare::Bag; use strict; use warnings; -use base 'Test2::Compare::Base'; +BEGIN { require Test2::Compare::Base; our @ISA = qw(Test2::Compare::Base) } our $VERSION = '1.302220'; diff --git a/lib/Test2/Compare/Base.pm b/lib/Test2/Compare/Base.pm index 94bf1c942..85fd29c62 100644 --- a/lib/Test2/Compare/Base.pm +++ b/lib/Test2/Compare/Base.pm @@ -142,7 +142,7 @@ All comparison classes for Test2::Compare should inherit from this base class. use strict; use warnings; - use base 'Test2::Compare::Base'; + BEGIN { require Test2::Compare::Base; our @ISA = qw(Test2::Compare::Base) } use Test2::Util::HashBase qw/stuff/; sub name { 'STUFF' } diff --git a/lib/Test2/Compare/Bool.pm b/lib/Test2/Compare/Bool.pm index 962cd5c15..d1db0606a 100644 --- a/lib/Test2/Compare/Bool.pm +++ b/lib/Test2/Compare/Bool.pm @@ -4,7 +4,7 @@ use warnings; use Carp qw/confess/; -use base 'Test2::Compare::Base'; +BEGIN { require Test2::Compare::Base; our @ISA = qw(Test2::Compare::Base) } our $VERSION = '1.302220'; diff --git a/lib/Test2/Compare/Custom.pm b/lib/Test2/Compare/Custom.pm index 34eeb728b..fdbe826a2 100644 --- a/lib/Test2/Compare/Custom.pm +++ b/lib/Test2/Compare/Custom.pm @@ -2,7 +2,7 @@ package Test2::Compare::Custom; use strict; use warnings; -use base 'Test2::Compare::Base'; +BEGIN { require Test2::Compare::Base; our @ISA = qw(Test2::Compare::Base) } our $VERSION = '1.302220'; diff --git a/lib/Test2/Compare/DeepRef.pm b/lib/Test2/Compare/DeepRef.pm index 709778cf7..9c7f00a1a 100644 --- a/lib/Test2/Compare/DeepRef.pm +++ b/lib/Test2/Compare/DeepRef.pm @@ -2,7 +2,7 @@ package Test2::Compare::DeepRef; use strict; use warnings; -use base 'Test2::Compare::Base'; +BEGIN { require Test2::Compare::Base; our @ISA = qw(Test2::Compare::Base) } our $VERSION = '1.302220'; diff --git a/lib/Test2/Compare/Event.pm b/lib/Test2/Compare/Event.pm index 1c388c170..04ed634da 100644 --- a/lib/Test2/Compare/Event.pm +++ b/lib/Test2/Compare/Event.pm @@ -6,7 +6,7 @@ use Scalar::Util qw/blessed/; use Test2::Compare::EventMeta(); -use base 'Test2::Compare::Object'; +BEGIN { require Test2::Compare::Object; our @ISA = qw(Test2::Compare::Object) } our $VERSION = '1.302220'; diff --git a/lib/Test2/Compare/EventMeta.pm b/lib/Test2/Compare/EventMeta.pm index 4d201c54e..388b47ab9 100644 --- a/lib/Test2/Compare/EventMeta.pm +++ b/lib/Test2/Compare/EventMeta.pm @@ -2,7 +2,7 @@ package Test2::Compare::EventMeta; use strict; use warnings; -use base 'Test2::Compare::Meta'; +BEGIN { require Test2::Compare::Meta; our @ISA = qw(Test2::Compare::Meta) } our $VERSION = '1.302220'; diff --git a/lib/Test2/Compare/Float.pm b/lib/Test2/Compare/Float.pm index f06ecc03e..c1da9da21 100644 --- a/lib/Test2/Compare/Float.pm +++ b/lib/Test2/Compare/Float.pm @@ -4,7 +4,7 @@ use warnings; use Carp qw/confess/; -use base 'Test2::Compare::Base'; +BEGIN { require Test2::Compare::Base; our @ISA = qw(Test2::Compare::Base) } our $VERSION = '1.302220'; diff --git a/lib/Test2/Compare/Hash.pm b/lib/Test2/Compare/Hash.pm index 62e44c37d..b34a4b2a8 100644 --- a/lib/Test2/Compare/Hash.pm +++ b/lib/Test2/Compare/Hash.pm @@ -2,7 +2,7 @@ package Test2::Compare::Hash; use strict; use warnings; -use base 'Test2::Compare::Base'; +BEGIN { require Test2::Compare::Base; our @ISA = qw(Test2::Compare::Base) } our $VERSION = '1.302220'; diff --git a/lib/Test2/Compare/Isa.pm b/lib/Test2/Compare/Isa.pm index ab176069b..a59127e80 100644 --- a/lib/Test2/Compare/Isa.pm +++ b/lib/Test2/Compare/Isa.pm @@ -5,7 +5,7 @@ use warnings; use Carp qw/confess/; use Scalar::Util qw/blessed/; -use base 'Test2::Compare::Base'; +BEGIN { require Test2::Compare::Base; our @ISA = qw(Test2::Compare::Base) } our $VERSION = '1.302220'; diff --git a/lib/Test2/Compare/Meta.pm b/lib/Test2/Compare/Meta.pm index ab545e08f..72946efee 100644 --- a/lib/Test2/Compare/Meta.pm +++ b/lib/Test2/Compare/Meta.pm @@ -5,7 +5,7 @@ use warnings; use Test2::Compare::Delta(); use Test2::Compare::Isa(); -use base 'Test2::Compare::Base'; +BEGIN { require Test2::Compare::Base; our @ISA = qw(Test2::Compare::Base) } our $VERSION = '1.302220'; diff --git a/lib/Test2/Compare/Number.pm b/lib/Test2/Compare/Number.pm index 1ce8cbbc7..23f0993df 100644 --- a/lib/Test2/Compare/Number.pm +++ b/lib/Test2/Compare/Number.pm @@ -4,7 +4,7 @@ use warnings; use Carp qw/confess/; -use base 'Test2::Compare::Base'; +BEGIN { require Test2::Compare::Base; our @ISA = qw(Test2::Compare::Base) } our $VERSION = '1.302220'; diff --git a/lib/Test2/Compare/Object.pm b/lib/Test2/Compare/Object.pm index 717b9f16d..267bfcfc3 100644 --- a/lib/Test2/Compare/Object.pm +++ b/lib/Test2/Compare/Object.pm @@ -6,7 +6,7 @@ use Test2::Util qw/try/; use Test2::Compare::Meta(); -use base 'Test2::Compare::Base'; +BEGIN { require Test2::Compare::Base; our @ISA = qw(Test2::Compare::Base) } our $VERSION = '1.302220'; diff --git a/lib/Test2/Compare/OrderedSubset.pm b/lib/Test2/Compare/OrderedSubset.pm index c93f0db25..1e3ceaa9d 100644 --- a/lib/Test2/Compare/OrderedSubset.pm +++ b/lib/Test2/Compare/OrderedSubset.pm @@ -2,7 +2,7 @@ package Test2::Compare::OrderedSubset; use strict; use warnings; -use base 'Test2::Compare::Base'; +BEGIN { require Test2::Compare::Base; our @ISA = qw(Test2::Compare::Base) } our $VERSION = '1.302220'; diff --git a/lib/Test2/Compare/Pattern.pm b/lib/Test2/Compare/Pattern.pm index ebd07d1de..c5744a712 100644 --- a/lib/Test2/Compare/Pattern.pm +++ b/lib/Test2/Compare/Pattern.pm @@ -2,7 +2,7 @@ package Test2::Compare::Pattern; use strict; use warnings; -use base 'Test2::Compare::Base'; +BEGIN { require Test2::Compare::Base; our @ISA = qw(Test2::Compare::Base) } our $VERSION = '1.302220'; diff --git a/lib/Test2/Compare/Ref.pm b/lib/Test2/Compare/Ref.pm index 6f9140e32..48cae8292 100644 --- a/lib/Test2/Compare/Ref.pm +++ b/lib/Test2/Compare/Ref.pm @@ -2,7 +2,7 @@ package Test2::Compare::Ref; use strict; use warnings; -use base 'Test2::Compare::Base'; +BEGIN { require Test2::Compare::Base; our @ISA = qw(Test2::Compare::Base) } our $VERSION = '1.302220'; diff --git a/lib/Test2/Compare/Regex.pm b/lib/Test2/Compare/Regex.pm index af3833731..f65405de9 100644 --- a/lib/Test2/Compare/Regex.pm +++ b/lib/Test2/Compare/Regex.pm @@ -2,7 +2,7 @@ package Test2::Compare::Regex; use strict; use warnings; -use base 'Test2::Compare::Base'; +BEGIN { require Test2::Compare::Base; our @ISA = qw(Test2::Compare::Base) } our $VERSION = '1.302220'; diff --git a/lib/Test2/Compare/Scalar.pm b/lib/Test2/Compare/Scalar.pm index 5a9076b48..927f8b38c 100644 --- a/lib/Test2/Compare/Scalar.pm +++ b/lib/Test2/Compare/Scalar.pm @@ -2,7 +2,7 @@ package Test2::Compare::Scalar; use strict; use warnings; -use base 'Test2::Compare::Base'; +BEGIN { require Test2::Compare::Base; our @ISA = qw(Test2::Compare::Base) } our $VERSION = '1.302220'; diff --git a/lib/Test2/Compare/Set.pm b/lib/Test2/Compare/Set.pm index 5bdbca3ff..c8c22930c 100644 --- a/lib/Test2/Compare/Set.pm +++ b/lib/Test2/Compare/Set.pm @@ -2,7 +2,7 @@ package Test2::Compare::Set; use strict; use warnings; -use base 'Test2::Compare::Base'; +BEGIN { require Test2::Compare::Base; our @ISA = qw(Test2::Compare::Base) } our $VERSION = '1.302220'; diff --git a/lib/Test2/Compare/String.pm b/lib/Test2/Compare/String.pm index 497a74356..f8c9c381d 100644 --- a/lib/Test2/Compare/String.pm +++ b/lib/Test2/Compare/String.pm @@ -4,7 +4,7 @@ use warnings; use Carp qw/confess/; -use base 'Test2::Compare::Base'; +BEGIN { require Test2::Compare::Base; our @ISA = qw(Test2::Compare::Base) } our $VERSION = '1.302220'; diff --git a/lib/Test2/Compare/Undef.pm b/lib/Test2/Compare/Undef.pm index e1dc04d01..18231cb0d 100644 --- a/lib/Test2/Compare/Undef.pm +++ b/lib/Test2/Compare/Undef.pm @@ -4,7 +4,7 @@ use warnings; use Carp qw/confess/; -use base 'Test2::Compare::Base'; +BEGIN { require Test2::Compare::Base; our @ISA = qw(Test2::Compare::Base) } our $VERSION = '1.302220'; diff --git a/lib/Test2/Compare/Wildcard.pm b/lib/Test2/Compare/Wildcard.pm index c382a712b..c7ed7111a 100644 --- a/lib/Test2/Compare/Wildcard.pm +++ b/lib/Test2/Compare/Wildcard.pm @@ -2,7 +2,7 @@ package Test2::Compare::Wildcard; use strict; use warnings; -use base 'Test2::Compare::Base'; +BEGIN { require Test2::Compare::Base; our @ISA = qw(Test2::Compare::Base) } our $VERSION = '1.302220'; diff --git a/lib/Test2/Event.pm b/lib/Test2/Event.pm index afd9a910c..e979d2d7d 100644 --- a/lib/Test2/Event.pm +++ b/lib/Test2/Event.pm @@ -345,7 +345,7 @@ L. use warnings; # This will make our class an event subclass (required) - use base 'Test2::Event'; + BEGIN { require Test2::Event; our @ISA = qw(Test2::Event) } # Add some accessors (optional) # You are not obligated to use HashBase, you can use any object tool you diff --git a/lib/Test2/IPC/Driver.pm b/lib/Test2/IPC/Driver.pm index 344db8ccf..b954eff1d 100644 --- a/lib/Test2/IPC/Driver.pm +++ b/lib/Test2/IPC/Driver.pm @@ -69,7 +69,7 @@ Test2::IPC::Driver - Base class for Test2 IPC drivers. package Test2::IPC::Driver::MyDriver; - use base 'Test2::IPC::Driver'; + BEGIN { require Test2::IPC::Driver; our @ISA = qw(Test2::IPC::Driver) } ... @@ -110,7 +110,7 @@ load it too late for it to be effective. use strict; use warnings; - use base 'Test2::IPC::Driver'; + BEGIN { require Test2::IPC::Driver; our @ISA = qw(Test2::IPC::Driver) } sub is_viable { return 0 if $^O eq 'win32'; # Will not work on windows. diff --git a/lib/Test2/Manual/Tooling/FirstTool.pm b/lib/Test2/Manual/Tooling/FirstTool.pm index 0a1eb7fde..4c0d3a41f 100644 --- a/lib/Test2/Manual/Tooling/FirstTool.pm +++ b/lib/Test2/Manual/Tooling/FirstTool.pm @@ -23,7 +23,7 @@ tool. use Test2::API qw/context/; - use base 'Exporter'; + BEGIN { require Exporter; our @ISA = qw(Exporter) } our @EXPORT = qw/ok/; sub ok($;$@) { diff --git a/lib/Test2/Manual/Tooling/Formatter.pm b/lib/Test2/Manual/Tooling/Formatter.pm index fa8aababa..04d08e33d 100644 --- a/lib/Test2/Manual/Tooling/Formatter.pm +++ b/lib/Test2/Manual/Tooling/Formatter.pm @@ -25,7 +25,7 @@ complicated, but this will give you the basics needed to get started. use JSON::MaybeXS qw/encode_json/; - use base qw/Test2::Formatter/; + BEGIN { require Test2::Formatter; our @ISA = qw(Test2::Formatter) } sub new { bless {}, shift } @@ -44,7 +44,7 @@ complicated, but this will give you the basics needed to get started. =over 4 -=item use base qw/Test2::Formatter/; +=item BEGIN { require Test2::Formatter; our @ISA = qw(Test2::Formatter) } All formatters should inherit from L. diff --git a/lib/Test2/Require.pm b/lib/Test2/Require.pm index 62ed972da..796f6bc19 100644 --- a/lib/Test2/Require.pm +++ b/lib/Test2/Require.pm @@ -52,7 +52,7 @@ so. use strict; use warnings; - use base 'Test2::Require'; + BEGIN { require Test2::Require; our @ISA = qw(Test2::Require) } sub HAVE_WIDGETS { ... }; diff --git a/lib/Test2/Require/AuthorTesting.pm b/lib/Test2/Require/AuthorTesting.pm index 8e7c02a85..f9a5f72cf 100644 --- a/lib/Test2/Require/AuthorTesting.pm +++ b/lib/Test2/Require/AuthorTesting.pm @@ -2,7 +2,7 @@ package Test2::Require::AuthorTesting; use strict; use warnings; -use base 'Test2::Require'; +BEGIN { require Test2::Require; our @ISA = qw(Test2::Require) } our $VERSION = '1.302220'; diff --git a/lib/Test2/Require/AutomatedTesting.pm b/lib/Test2/Require/AutomatedTesting.pm index 878720f0b..9af45fe5e 100644 --- a/lib/Test2/Require/AutomatedTesting.pm +++ b/lib/Test2/Require/AutomatedTesting.pm @@ -2,7 +2,7 @@ package Test2::Require::AutomatedTesting; use strict; use warnings; -use base 'Test2::Require'; +BEGIN { require Test2::Require; our @ISA = qw(Test2::Require) } our $VERSION = '1.302220'; diff --git a/lib/Test2/Require/EnvVar.pm b/lib/Test2/Require/EnvVar.pm index 828641d7a..34d38db41 100644 --- a/lib/Test2/Require/EnvVar.pm +++ b/lib/Test2/Require/EnvVar.pm @@ -3,7 +3,7 @@ use strict; use warnings; use Carp qw/confess/; -use base 'Test2::Require'; +BEGIN { require Test2::Require; our @ISA = qw(Test2::Require) } our $VERSION = '1.302220'; diff --git a/lib/Test2/Require/ExtendedTesting.pm b/lib/Test2/Require/ExtendedTesting.pm index b6b4899a0..aba73b6b9 100644 --- a/lib/Test2/Require/ExtendedTesting.pm +++ b/lib/Test2/Require/ExtendedTesting.pm @@ -2,7 +2,7 @@ package Test2::Require::ExtendedTesting; use strict; use warnings; -use base 'Test2::Require'; +BEGIN { require Test2::Require; our @ISA = qw(Test2::Require) } our $VERSION = '1.302220'; diff --git a/lib/Test2/Require/Fork.pm b/lib/Test2/Require/Fork.pm index 76c37aa3b..a12bb11fa 100644 --- a/lib/Test2/Require/Fork.pm +++ b/lib/Test2/Require/Fork.pm @@ -2,7 +2,7 @@ package Test2::Require::Fork; use strict; use warnings; -use base 'Test2::Require'; +BEGIN { require Test2::Require; our @ISA = qw(Test2::Require) } our $VERSION = '1.302220'; diff --git a/lib/Test2/Require/Module.pm b/lib/Test2/Require/Module.pm index 8380989e4..d7629e27b 100644 --- a/lib/Test2/Require/Module.pm +++ b/lib/Test2/Require/Module.pm @@ -2,7 +2,7 @@ package Test2::Require::Module; use strict; use warnings; -use base 'Test2::Require'; +BEGIN { require Test2::Require; our @ISA = qw(Test2::Require) } our $VERSION = '1.302220'; diff --git a/lib/Test2/Require/NonInteractiveTesting.pm b/lib/Test2/Require/NonInteractiveTesting.pm index aa86932a6..86acd681d 100644 --- a/lib/Test2/Require/NonInteractiveTesting.pm +++ b/lib/Test2/Require/NonInteractiveTesting.pm @@ -2,7 +2,7 @@ package Test2::Require::NonInteractiveTesting; use strict; use warnings; -use base 'Test2::Require'; +BEGIN { require Test2::Require; our @ISA = qw(Test2::Require) } our $VERSION = '1.302220'; diff --git a/lib/Test2/Require/Perl.pm b/lib/Test2/Require/Perl.pm index e147890c1..32968135b 100644 --- a/lib/Test2/Require/Perl.pm +++ b/lib/Test2/Require/Perl.pm @@ -2,7 +2,7 @@ package Test2::Require::Perl; use strict; use warnings; -use base 'Test2::Require'; +BEGIN { require Test2::Require; our @ISA = qw(Test2::Require) } our $VERSION = '1.302220'; diff --git a/lib/Test2/Require/RealFork.pm b/lib/Test2/Require/RealFork.pm index aba78ba85..ddf93472e 100644 --- a/lib/Test2/Require/RealFork.pm +++ b/lib/Test2/Require/RealFork.pm @@ -2,7 +2,7 @@ package Test2::Require::RealFork; use strict; use warnings; -use base 'Test2::Require'; +BEGIN { require Test2::Require; our @ISA = qw(Test2::Require) } our $VERSION = '1.302220'; diff --git a/lib/Test2/Require/ReleaseTesting.pm b/lib/Test2/Require/ReleaseTesting.pm index b9dfa2f1f..79e9cd6cb 100644 --- a/lib/Test2/Require/ReleaseTesting.pm +++ b/lib/Test2/Require/ReleaseTesting.pm @@ -2,7 +2,7 @@ package Test2::Require::ReleaseTesting; use strict; use warnings; -use base 'Test2::Require'; +BEGIN { require Test2::Require; our @ISA = qw(Test2::Require) } our $VERSION = '1.302220'; diff --git a/lib/Test2/Tools.pm b/lib/Test2/Tools.pm index 965188521..e9309e9fe 100644 --- a/lib/Test2/Tools.pm +++ b/lib/Test2/Tools.pm @@ -56,7 +56,7 @@ It is very easy to write tools: use Test2::API qw/context/; our @EXPORTS = qw/ok plan/; - use base 'Exporter'; + BEGIN { require Exporter; our @ISA = qw(Exporter) } sub ok($;$) { my ($bool, $name) = @_; diff --git a/lib/Test2/Tools/AsyncSubtest.pm b/lib/Test2/Tools/AsyncSubtest.pm index 61371ea4a..de1d363d8 100644 --- a/lib/Test2/Tools/AsyncSubtest.pm +++ b/lib/Test2/Tools/AsyncSubtest.pm @@ -10,7 +10,7 @@ use Test2::API qw/context/; use Carp qw/croak/; our @EXPORT = qw/async_subtest fork_subtest thread_subtest/; -use base 'Exporter'; +BEGIN { require Exporter; our @ISA = qw(Exporter) } sub async_subtest { my $name = shift; diff --git a/lib/Test2/Tools/Basic.pm b/lib/Test2/Tools/Basic.pm index 4fb8d433e..2e2e4f104 100644 --- a/lib/Test2/Tools/Basic.pm +++ b/lib/Test2/Tools/Basic.pm @@ -11,7 +11,7 @@ our @EXPORT = qw{ ok pass fail diag note todo skip plan skip_all done_testing bail_out }; -use base 'Exporter'; +BEGIN { require Exporter; our @ISA = qw(Exporter) } sub ok($;$@) { my ($bool, $name, @diag) = @_; diff --git a/lib/Test2/Tools/Class.pm b/lib/Test2/Tools/Class.pm index 3c6de9d0e..622626166 100644 --- a/lib/Test2/Tools/Class.pm +++ b/lib/Test2/Tools/Class.pm @@ -10,7 +10,7 @@ use Test2::Util::Ref qw/render_ref/; use Scalar::Util qw/blessed/; our @EXPORT = qw/can_ok isa_ok DOES_ok/; -use base 'Exporter'; +BEGIN { require Exporter; our @ISA = qw(Exporter) } # For easier grepping # sub isa_ok is defined here diff --git a/lib/Test2/Tools/ClassicCompare.pm b/lib/Test2/Tools/ClassicCompare.pm index 6dd003599..86617fc08 100644 --- a/lib/Test2/Tools/ClassicCompare.pm +++ b/lib/Test2/Tools/ClassicCompare.pm @@ -5,7 +5,7 @@ use warnings; our $VERSION = '1.302220'; our @EXPORT = qw/is is_deeply isnt like unlike cmp_ok/; -use base 'Exporter'; +BEGIN { require Exporter; our @ISA = qw(Exporter) } use Carp qw/carp/; use Scalar::Util qw/reftype/; diff --git a/lib/Test2/Tools/Compare.pm b/lib/Test2/Tools/Compare.pm index 355665e22..8a9d521ac 100644 --- a/lib/Test2/Tools/Compare.pm +++ b/lib/Test2/Tools/Compare.pm @@ -77,7 +77,7 @@ our @EXPORT_OK = qw{ event fail_events exact_ref }; -use base 'Exporter'; +BEGIN { require Exporter; our @ISA = qw(Exporter) } my $_autodump = sub { my ($ctx, $got) = @_; diff --git a/lib/Test2/Tools/Defer.pm b/lib/Test2/Tools/Defer.pm index 0d6f08e5a..0b176c34a 100644 --- a/lib/Test2/Tools/Defer.pm +++ b/lib/Test2/Tools/Defer.pm @@ -13,7 +13,7 @@ use Test2::API qw{ }; our @EXPORT = qw/def do_def/; -use base 'Exporter'; +BEGIN { require Exporter; our @ISA = qw(Exporter) } my %TODO; diff --git a/lib/Test2/Tools/Encoding.pm b/lib/Test2/Tools/Encoding.pm index 1b93ba58b..2e794c513 100644 --- a/lib/Test2/Tools/Encoding.pm +++ b/lib/Test2/Tools/Encoding.pm @@ -6,7 +6,7 @@ use Carp qw/croak/; use Test2::API qw/test2_stack/; -use base 'Exporter'; +BEGIN { require Exporter; our @ISA = qw(Exporter) } our $VERSION = '1.302220'; diff --git a/lib/Test2/Tools/Event.pm b/lib/Test2/Tools/Event.pm index c71cc3783..a10d36f56 100644 --- a/lib/Test2/Tools/Event.pm +++ b/lib/Test2/Tools/Event.pm @@ -7,7 +7,7 @@ our $VERSION = '1.302220'; use Test2::Util qw/pkg_to_file/; our @EXPORT = qw/gen_event/; -use base 'Exporter'; +BEGIN { require Exporter; our @ISA = qw(Exporter) } sub gen_event { my ($type, %fields) = @_; diff --git a/lib/Test2/Tools/Exception.pm b/lib/Test2/Tools/Exception.pm index 6681224ac..896cf6d2c 100644 --- a/lib/Test2/Tools/Exception.pm +++ b/lib/Test2/Tools/Exception.pm @@ -8,7 +8,7 @@ use Carp qw/carp/; use Test2::API qw/context test2_add_pending_diag test2_clear_pending_diags/; our @EXPORT = qw/dies lives try_ok/; -use base 'Exporter'; +BEGIN { require Exporter; our @ISA = qw(Exporter) } sub dies(&) { my $code = shift; diff --git a/lib/Test2/Tools/Exports.pm b/lib/Test2/Tools/Exports.pm index a5aa8bd66..32a13f538 100644 --- a/lib/Test2/Tools/Exports.pm +++ b/lib/Test2/Tools/Exports.pm @@ -9,7 +9,7 @@ use Test2::API qw/context/; use Test2::Util::Stash qw/get_symbol/; our @EXPORT = qw/imported_ok not_imported_ok/; -use base 'Exporter'; +BEGIN { require Exporter; our @ISA = qw(Exporter) } sub imported_ok { my $ctx = context(); diff --git a/lib/Test2/Tools/GenTemp.pm b/lib/Test2/Tools/GenTemp.pm index 6ce25af5a..2100bca88 100644 --- a/lib/Test2/Tools/GenTemp.pm +++ b/lib/Test2/Tools/GenTemp.pm @@ -9,7 +9,7 @@ use File::Temp qw/tempdir/; use File::Spec; our @EXPORT = qw{gen_temp}; -use base 'Exporter'; +BEGIN { require Exporter; our @ISA = qw(Exporter) } sub gen_temp { my %args = @_; diff --git a/lib/Test2/Tools/Grab.pm b/lib/Test2/Tools/Grab.pm index 56c875b76..83b59ef62 100644 --- a/lib/Test2/Tools/Grab.pm +++ b/lib/Test2/Tools/Grab.pm @@ -8,7 +8,7 @@ use Test2::Util::Grabber; use Test2::EventFacet::Trace(); our @EXPORT = qw/grab/; -use base 'Exporter'; +BEGIN { require Exporter; our @ISA = qw(Exporter) } sub grab { Test2::Util::Grabber->new(trace => Test2::EventFacet::Trace->new(frame => [caller(0)]) ) } diff --git a/lib/Test2/Tools/Mock.pm b/lib/Test2/Tools/Mock.pm index c1fc4a5bc..19a4ef6bb 100644 --- a/lib/Test2/Tools/Mock.pm +++ b/lib/Test2/Tools/Mock.pm @@ -9,7 +9,7 @@ use Test2::Util::Sub qw/gen_accessor gen_reader gen_writer/; use Test2::Mock(); -use base 'Exporter'; +BEGIN { require Exporter; our @ISA = qw(Exporter) } our $VERSION = '1.302220'; diff --git a/lib/Test2/Tools/Ref.pm b/lib/Test2/Tools/Ref.pm index 33bea1ca0..85158c357 100644 --- a/lib/Test2/Tools/Ref.pm +++ b/lib/Test2/Tools/Ref.pm @@ -9,7 +9,7 @@ use Test2::API qw/context/; use Test2::Util::Ref qw/render_ref/; our @EXPORT = qw/ref_ok ref_is ref_is_not/; -use base 'Exporter'; +BEGIN { require Exporter; our @ISA = qw(Exporter) } sub ref_ok($;$$) { my ($thing, $wanttype, $name) = @_; diff --git a/lib/Test2/Tools/Refcount.pm b/lib/Test2/Tools/Refcount.pm index a5f6636b9..04e2e5865 100644 --- a/lib/Test2/Tools/Refcount.pm +++ b/lib/Test2/Tools/Refcount.pm @@ -24,7 +24,7 @@ our @EXPORT_OK = qw( refcount ); -use base qw(Exporter); +BEGIN { require Exporter; our @ISA = qw(Exporter) } use constant HAVE_DEVEL_MAT_DUMPER => defined eval { package # No Index diff --git a/lib/Test2/Tools/Subtest.pm b/lib/Test2/Tools/Subtest.pm index 09cfb9540..ea7cc099b 100644 --- a/lib/Test2/Tools/Subtest.pm +++ b/lib/Test2/Tools/Subtest.pm @@ -8,7 +8,7 @@ use Test2::API qw/context run_subtest/; use Test2::Util qw/try/; our @EXPORT = qw/subtest_streamed subtest_buffered/; -use base 'Exporter'; +BEGIN { require Exporter; our @ISA = qw(Exporter) } sub subtest_streamed { my $name = shift; diff --git a/lib/Test2/Tools/Warnings.pm b/lib/Test2/Tools/Warnings.pm index c9a3dc24f..f0c026455 100644 --- a/lib/Test2/Tools/Warnings.pm +++ b/lib/Test2/Tools/Warnings.pm @@ -8,7 +8,7 @@ use Carp qw/carp/; use Test2::API qw/context test2_add_pending_diag/; our @EXPORT = qw/warns warning warnings no_warnings/; -use base 'Exporter'; +BEGIN { require Exporter; our @ISA = qw(Exporter) } sub warns(&) { my $code = shift; diff --git a/lib/Test2/Util/HashBase.pm b/lib/Test2/Util/HashBase.pm index 4dfe4ce2c..1aab354b4 100644 --- a/lib/Test2/Util/HashBase.pm +++ b/lib/Test2/Util/HashBase.pm @@ -202,7 +202,7 @@ Subclass it use warnings; # Note, you should subclass before loading HashBase. - use base 'My::Class'; + BEGIN { require My::Class; our @ISA = qw(My::Class) } use Test2::Util::HashBase qw/bub/; sub init { @@ -413,7 +413,7 @@ This does not create any methods for you, it just adds the C constant. You can subclass an existing HashBase class. - use base 'Another::HashBase::Class'; + BEGIN { require Another::HashBase::Class; our @ISA = qw(Another::HashBase::Class) } use Test2::Util::HashBase qw/foo bar baz/; The base class is added to C<@ISA> for you, and all constants from base classes diff --git a/lib/Test2/Util/Ref.pm b/lib/Test2/Util/Ref.pm index 43f03b2e4..d417773aa 100644 --- a/lib/Test2/Util/Ref.pm +++ b/lib/Test2/Util/Ref.pm @@ -7,7 +7,7 @@ our $VERSION = '1.302220'; use Scalar::Util qw/reftype blessed refaddr/; our @EXPORT_OK = qw/rtype render_ref/; -use base 'Exporter'; +BEGIN { require Exporter; our @ISA = qw(Exporter) } sub rtype { my ($thing) = @_; diff --git a/lib/Test2/Util/Stash.pm b/lib/Test2/Util/Stash.pm index 4c3c25c4d..632e2cb4d 100644 --- a/lib/Test2/Util/Stash.pm +++ b/lib/Test2/Util/Stash.pm @@ -15,7 +15,7 @@ our @EXPORT_OK = qw{ purge_symbol slot_to_sig sig_to_slot }; -use base 'Exporter'; +BEGIN { require Exporter; our @ISA = qw(Exporter) } my %SIGMAP = ( '&' => 'CODE', diff --git a/lib/Test2/Util/Sub.pm b/lib/Test2/Util/Sub.pm index b31d43764..54d85147e 100644 --- a/lib/Test2/Util/Sub.pm +++ b/lib/Test2/Util/Sub.pm @@ -13,7 +13,7 @@ our @EXPORT_OK = qw{ gen_reader gen_writer gen_accessor }; -use base 'Exporter'; +BEGIN { require Exporter; our @ISA = qw(Exporter) } sub gen_reader { my $field = shift; diff --git a/lib/Test2/Util/Table.pm b/lib/Test2/Util/Table.pm index d19376cc0..9fba8a95b 100644 --- a/lib/Test2/Util/Table.pm +++ b/lib/Test2/Util/Table.pm @@ -4,7 +4,7 @@ use warnings; our $VERSION = '1.302220'; -use base 'Term::Table'; +BEGIN { require Term::Table; our @ISA = qw(Term::Table) } use Test2::Util::Importer 'Test2::Util::Importer' => 'import'; our @EXPORT_OK = qw/table/; diff --git a/lib/Test2/Util/Table/Cell.pm b/lib/Test2/Util/Table/Cell.pm index d1bcd8174..78d4b0b43 100644 --- a/lib/Test2/Util/Table/Cell.pm +++ b/lib/Test2/Util/Table/Cell.pm @@ -4,6 +4,6 @@ use warnings; our $VERSION = '1.302220'; -use base 'Term::Table::Cell'; +BEGIN { require Term::Table::Cell; our @ISA = qw(Term::Table::Cell) } 1; diff --git a/lib/Test2/Util/Table/LineBreak.pm b/lib/Test2/Util/Table/LineBreak.pm index d2d33e0e9..a5a86a437 100644 --- a/lib/Test2/Util/Table/LineBreak.pm +++ b/lib/Test2/Util/Table/LineBreak.pm @@ -4,7 +4,7 @@ use warnings; our $VERSION = '1.302220'; -use base 'Term::Table::LineBreak'; +BEGIN { require Term::Table::LineBreak; our @ISA = qw(Term::Table::LineBreak) } 1; diff --git a/lib/Test2/Util/Times.pm b/lib/Test2/Util/Times.pm index 4399a7e16..1ff350b21 100644 --- a/lib/Test2/Util/Times.pm +++ b/lib/Test2/Util/Times.pm @@ -7,7 +7,7 @@ use List::Util qw/sum/; our $VERSION = '1.302220'; our @EXPORT_OK = qw/render_bench render_duration/; -use base 'Exporter'; +BEGIN { require Exporter; our @ISA = qw(Exporter) } sub render_duration { my $time; diff --git a/lib/Test2/Workflow.pm b/lib/Test2/Workflow.pm index 7aaa3cdd0..78414ee99 100644 --- a/lib/Test2/Workflow.pm +++ b/lib/Test2/Workflow.pm @@ -5,7 +5,7 @@ use warnings; our $VERSION = '1.302220'; our @EXPORT_OK = qw/parse_args current_build build root_build init_root build_stack/; -use base 'Exporter'; +BEGIN { require Exporter; our @ISA = qw(Exporter) } use Test2::Workflow::Build; use Test2::Workflow::Task::Group; diff --git a/lib/Test2/Workflow/Build.pm b/lib/Test2/Workflow/Build.pm index 15e6ba3ac..35e3589ad 100644 --- a/lib/Test2/Workflow/Build.pm +++ b/lib/Test2/Workflow/Build.pm @@ -18,7 +18,7 @@ BEGIN { }; } -use base 'Test2::Workflow::Task'; +BEGIN { require Test2::Workflow::Task; our @ISA = qw(Test2::Workflow::Task) } use Test2::Util::HashBase @BUILD_FIELDS, qw/events defaults stack_stop/; sub init { diff --git a/lib/Test2/Workflow/Task.pm b/lib/Test2/Workflow/Task.pm index ba644f846..f3e6af486 100644 --- a/lib/Test2/Workflow/Task.pm +++ b/lib/Test2/Workflow/Task.pm @@ -12,7 +12,7 @@ use Scalar::Util qw/blessed/; use Carp qw/croak/; our @CARP_NOT = qw/Test2::Util::HashBase/; -use base 'Test2::Workflow::BlockBase'; +BEGIN { require Test2::Workflow::BlockBase; our @ISA = qw(Test2::Workflow::BlockBase) } use Test2::Util::HashBase qw/name flat async iso todo skip scaffold events is_root/; for my $attr (FLAT, ISO, ASYNC, TODO, SKIP, SCAFFOLD) { diff --git a/lib/Test2/Workflow/Task/Action.pm b/lib/Test2/Workflow/Task/Action.pm index b4f22a82e..5a14f9ccb 100644 --- a/lib/Test2/Workflow/Task/Action.pm +++ b/lib/Test2/Workflow/Task/Action.pm @@ -4,7 +4,7 @@ use warnings; our $VERSION = '1.302220'; -use base 'Test2::Workflow::Task'; +BEGIN { require Test2::Workflow::Task; our @ISA = qw(Test2::Workflow::Task) } use Test2::Util::HashBase qw/around/; 1; diff --git a/lib/Test2/Workflow/Task/Group.pm b/lib/Test2/Workflow/Task/Group.pm index 264af9a7a..bf625e5d3 100644 --- a/lib/Test2/Workflow/Task/Group.pm +++ b/lib/Test2/Workflow/Task/Group.pm @@ -8,7 +8,7 @@ use Carp qw/croak/; use Test2::Workflow::Task::Action; -use base 'Test2::Workflow::Task'; +BEGIN { require Test2::Workflow::Task; our @ISA = qw(Test2::Workflow::Task) } use Test2::Util::HashBase qw/before after primary rand variant/; sub init {