Test::S...:ToTest2(3)
β¨ Test::S...:ToTest2 β¨
okay bestie, so this is a page from the User Contributed Perl Documentation (yes it's giving β¨communityβ¨), and it's literally your glow-up guide π
πΈ NAME πΈ
Test::Stream::Manual::ToTest2 β how to move your code over to Test2 / Test2-Suite πβ¨
π DESCRIPTION π
so here's the tea, bestie: Test::Stream is deprecated π in favor of Test2, Test2::Suite, and Test2::Workflow. it's not you, it's the ecosystem. it's giving "we're evolving" π¦
πΊοΈ MAP πΊοΈ
this section is your lil treasure map π§ β it briefly tells you where to look for replacements. no cap, just point you at the new spots.
π« THE GUTS AND INTERNALS π«
CONTEXT
if you used the context() method, it now lives in Test2::API and the usage is identical π― Converting from Test-Stream's context() function could be as easy as changing:
use Test::Stream::Context qw/context/
to
use Test2::API qw/context/
One major gotcha though π¬: the debug() attribute is gone. instead there's a trace() attribute, but heads up β its usage is not identical. don't assume, fr fr.
TODO/SKIP
TODO and SKIP are no longer managed inside the Context and DebugInfo objects. Skip is now a full fledged event type β Test2::Event::Skip β and Test2::API::Context has added a skip() method. slay π
TODO is no longer tracked at all by the Test2 internals. instead, look at Test2::Tools::Todo and/or Test2::Todo, which are both part of Test2::Suite. these tools manage TODO as a hub filter β¨
IPC
IPC has not changed much π§ load the Test2::IPC module to make sure IPC is loaded if you need it.
CAPABILITIES
Test::Stream::Capabilities has been merged with Test::Stream::Util in Test2::Util. two for one, iconic π
EXPORTER
Test::Stream::Exporter is completely gone π use Exporter, Export::Declare, Exporter::Declare, or Sub::Exporter.
HASHBASE
see Test2::Util::HashBase.
Change:
use Test::Stream::HashBase(
base => 'Parent::Class',
accessors => [qw/foo bar baz/],
);
To:
use parent 'Parent::Class';
use Test2::Util::HashBase qw/foo bar baz/;
EVENTS
see Test2::Event for the new event base class. Very little has changed apart from the HashBase usage π
SYNC
Test::Stream::Sync has been replaced by Test2::API. One major difference: Test2::API exports functions, you do not call class methods on it the way you did with Test2::Sync. Test2::API also adds and renames several functions π
HUB AND STATE
Test::Stream::Hub and Test::Stream::State have been merged into Test2::API::Stack. Methods from both are now in a single class. Some deprecated methods were removed βοΈ
π§° TOOLS, PLUGINS, FORMATTERS, ETC. π§°
there is a new namespace layout, bestie. Test::Stream::Plugin:: has been split into:
- Test2::Tools:: β Tools live here. π§
- Test2::Bundle:: β Bundles live here. π
- Test2::Plugin:: β Plugins (behavior modifications) live here. πͺ
- Test2::Require:: β Things that cause a test to skip all live here. π
- Test2::Formatter:: β Formatters live here. π
-V1
Test::Stream::Bundle::V1 is now spelled Test2::Bundle::Extended.
-Classic
Test::Stream::Bundle::Classic is now spelled Test2::Bundle::Classic. (yes the name stayed the same, we love consistency π«Ά)
π SPEC AND WORKFLOWS π
All the spec and workflow stuff has moved to Test2::Workflow. This was never made stable so I don't expect anyone to need a conversion guide. honestly? it's giving "we don't talk about that era" π
π§ͺ TESTING YOUR TESTS π§ͺ
Test2::API now exports the $events = intercept { ... } function. β¨ obsessed.
π SOURCE π
The source code repository for Test::Stream can be found at http://github.com/Test-More/Test-Stream/. go star it, it's free π
π«Ά MAINTAINERS π«Ά
Chad Granum <exodist@cpan.org>
π AUTHORS π
Chad Granum <exodist@cpan.org>
Β©οΈ COPYRIGHT Β©οΈ
Copyright 2015 Chad Granum <exodist7@gmail.com>.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
See http://dev.perl.org/licenses/
and that's the whole page, bestie π perl v5.42.0, dated 2025-07-25 β that's when this lil Test::S...:ToTest2(3) page was born. k bye, go migrate your tests, you got this πβ¨π¦
π¦ where this page comes from
- fedora 43: perl-Test-Stream 1.302027-35.fc43 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms