.\" -*- mode: troff; coding: utf-8 -*-
.\" Automatically generated by Pod::Man v6.0.2 (Pod::Simple 3.47)
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Vb \" Begin verbatim text
.ft CW
.nf
.ne \\$1
..
.de Ve \" End verbatim text
.ft R
.fi
..
.\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>.
.ie n \{\
.    ds C` ""
.    ds C' ""
'br\}
.el\{\
.    ds C`
.    ds C'
'br\}
.\"
.\" Escape single quotes in literal strings from groff's Unicode transform.
.ie \n(.g .ds Aq \(aq
.el       .ds Aq '
.\"
.\" If the F register is >0, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
.\" entries marked with X<> in POD.  Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.\"
.\" Avoid warning from groff about undefined register 'F'.
.de IX
..
.nr rF 0
.if \n(.g .if rF .nr rF 1
.if (\n(rF:(\n(.g==0)) \{\
.    if \nF \{\
.        de IX
.        tm Index:\\$1\t\\n%\t"\\$2"
..
.        if !\nF==2 \{\
.            nr % 0
.            nr F 2
.        \}
.    \}
.\}
.rr rF
.\"
.\" Required to disable full justification in groff 1.23.0.
.if n .ds AD l
.\" ========================================================================
.\"
.IX Title "Test2::Suite 3"
.TH Test2::Suite 3 2025-07-25 "perl v5.42.0" "User Contributed Perl Documentation"
.\" For nroff, turn off justification.  Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
.nh
.SH NAME
Test2::Suite \- Distribution with a rich set of tools built upon the Test2
framework.
.SH DESCRIPTION
.IX Header "DESCRIPTION"
Rich set of tools, plugins, bundles, etc built upon the Test2 testing
library. If you are interested in writing tests, this is the distribution for
you.
.SS "WHAT ARE TOOLS, PLUGINS, AND BUNDLES?"
.IX Subsection "WHAT ARE TOOLS, PLUGINS, AND BUNDLES?"
.IP TOOLS 4
.IX Item "TOOLS"
Tools are packages that export functions for use in test files. These functions
typically generate events. Tools \fBSHOULD NEVER\fR alter behavior of other tools,
or the system in general.
.IP PLUGINS 4
.IX Item "PLUGINS"
Plugins are packages that produce effects, or alter behavior of tools. An
example would be a plugin that causes the test to bail out after the first
failure. Plugins \fBSHOULD NOT\fR export anything.
.IP BUNDLES 4
.IX Item "BUNDLES"
Bundles are collections of tools and plugins. A bundle should load and
re\-export functions from Tool packages. A bundle may also load and configure
any number of plugins.
.PP
If you want to write something that both exports new functions, and affects
behavior, you should write both a Tools distribution, and a Plugin distribution,
then a Bundle that loads them both. This is important as it helps avoid the
problem where a package exports much\-desired tools, but
also produces undesirable side\-effects.
.SH "INCLUDED BUNDLES"
.IX Header "INCLUDED BUNDLES"
.IP Test2::V# 4
.IX Item "Test2::V#"
These do not live in the bundle namespace as they are the primary ways to use
Test2::Suite.
.Sp
The current latest is Test2::V0.
.Sp
.Vb 2
\&    use Test2::V0;
\&    # strict and warnings are on for you now.
\&
\&    ok(...);
\&
\&    # Note: is does deep checking, unlike the \*(Aqis\*(Aq from Test::More.
\&    is(...);
\&
\&    ...
\&
\&    done_testing;
.Ve
.Sp
This bundle includes every tool listed in the "INCLUDED TOOLS" section below,
except for Test2::Tools::ClassicCompare. This bundle provides most of what
anyone writing tests could need. This is also the preferred bundle/toolset of
the Test2 author.
.Sp
See Test2::V0 for complete documentation.
.IP Extended 4
.IX Item "Extended"
\&\fB** Deprecated **\fR See Test2::V0
.Sp
.Vb 2
\&    use Test2::Bundle::Extended;
\&    # strict and warnings are on for you now.
\&
\&    ok(...);
\&
\&    # Note: is does deep checking, unlike the \*(Aqis\*(Aq from Test::More.
\&    is(...);
\&
\&    ...
\&
\&    done_testing;
.Ve
.Sp
This bundle includes every tool listed in the "INCLUDED TOOLS" section below,
except for Test2::Tools::ClassicCompare. This bundle provides most of what
anyone writing tests could need. This is also the preferred bundle/toolset of
the Test2 author.
.Sp
See Test2::Bundle::Extended for complete documentation.
.IP More 4
.IX Item "More"
.Vb 3
\&    use Test2::Bundle::More;
\&    use strict;
\&    use warnings;
\&
\&    plan 3; # Or you can use done_testing at the end
\&
\&    ok(...);
\&
\&    is(...); # Note: String compare
\&
\&    is_deeply(...);
\&
\&    ...
\&
\&    done_testing; # Use instead of plan
.Ve
.Sp
This bundle is meant to be a \fImostly\fR drop\-in replacement for Test::More.
There are some notable differences to be aware of however. Some exports are
missing: \f(CW\*(C`eq_array\*(C'\fR, \f(CW\*(C`eq_hash\*(C'\fR, \f(CW\*(C`eq_set\*(C'\fR, \f(CW$TODO\fR, \f(CW\*(C`explain\*(C'\fR, \f(CW\*(C`use_ok\*(C'\fR,
\&\f(CW\*(C`require_ok\*(C'\fR. As well it is no longer possible to set the plan at import:
\&\f(CW\*(C`use .. tests => 5\*(C'\fR. \f(CW$TODO\fR has been replaced by the \f(CWtodo()\fR
function. Planning is done using \f(CW\*(C`plan\*(C'\fR, \f(CW\*(C`skip_all\*(C'\fR, or \f(CW\*(C`done_testing\*(C'\fR.
.Sp
See Test2::Bundle::More for complete documentation.
.IP Simple 4
.IX Item "Simple"
.Vb 3
\&    use Test2::Bundle::Simple;
\&    use strict;
\&    use warnings;
\&
\&    plan 1;
\&
\&    ok(...);
.Ve
.Sp
This bundle is meant to be a \fImostly\fR drop\-in replacement for Test::Simple.
See Test2::Bundle::Simple for complete documentation.
.SH "INCLUDED TOOLS"
.IX Header "INCLUDED TOOLS"
.IP Basic 4
.IX Item "Basic"
Basic provides most of the essential tools previously found in Test::More.
However it does not export any tools used for comparison. The basic \f(CW\*(C`pass\*(C'\fR,
\&\f(CW\*(C`fail\*(C'\fR, \f(CW\*(C`ok\*(C'\fR functions are present, as are functions for planning.
.Sp
See Test2::Tools::Basic for complete documentation.
.IP Compare 4
.IX Item "Compare"
This provides \f(CW\*(C`is\*(C'\fR, \f(CW\*(C`like\*(C'\fR, \f(CW\*(C`isnt\*(C'\fR, \f(CW\*(C`unlike\*(C'\fR, and several additional
helpers. \fBNote:\fR These are all \fIdeep\fR comparison tools and work like a
combination of Test::More\*(Aqs \f(CW\*(C`is\*(C'\fR and \f(CW\*(C`is_deeply\*(C'\fR.
.Sp
See Test2::Tools::Compare for complete documentation.
.IP ClassicCompare 4
.IX Item "ClassicCompare"
This provides Test::More flavored \f(CW\*(C`is\*(C'\fR, \f(CW\*(C`like\*(C'\fR, \f(CW\*(C`isnt\*(C'\fR, \f(CW\*(C`unlike\*(C'\fR, and
\&\f(CW\*(C`is_deeply\*(C'\fR. It also provides \f(CW\*(C`cmp_ok\*(C'\fR.
.Sp
See Test2::Tools::ClassicCompare for complete documentation.
.IP Class 4
.IX Item "Class"
This provides functions for testing objects and classes, things like \f(CW\*(C`isa_ok\*(C'\fR.
.Sp
See Test2::Tools::Class for complete documentation.
.IP Defer 4
.IX Item "Defer"
This provides functions for writing test functions in one place, but running
them later. This is useful for testing things that run in an altered state.
.Sp
See Test2::Tools::Defer for complete documentation.
.IP Encoding 4
.IX Item "Encoding"
This exports a single function that can be used to change the encoding of all
your test output.
.Sp
See Test2::Tools::Encoding for complete documentation.
.IP Exports 4
.IX Item "Exports"
This provides tools for verifying exports. You can verify that functions have
been imported, or that they have not been imported.
.Sp
See Test2::Tools::Exports for complete documentation.
.IP Mock 4
.IX Item "Mock"
This provides tools for mocking objects and classes. This is based largely on
Mock::Quick, but several interface improvements have been added that cannot
be added to Mock::Quick itself without breaking backwards compatibility.
.Sp
See Test2::Tools::Mock for complete documentation.
.IP Ref 4
.IX Item "Ref"
This exports tools for validating and comparing references.
.Sp
See Test2::Tools::Ref for complete documentation.
.IP Spec 4
.IX Item "Spec"
This is an RSPEC implementation with concurrency support.
.Sp
See Test2::Tools::Spec for more details.
.IP Subtest 4
.IX Item "Subtest"
This exports tools for running subtests.
.Sp
See Test2::Tools::Subtest for complete documentation.
.IP Target 4
.IX Item "Target"
This lets you load the package(s) you intend to test, and alias them into
constants/package variables.
.Sp
See Test2::Tools::Target for complete documentation.
.SH "INCLUDED PLUGINS"
.IX Header "INCLUDED PLUGINS"
.IP BailOnFail 4
.IX Item "BailOnFail"
The much requested "bail\-out on first failure" plugin. When this plugin is
loaded, any failure will cause the test to bail out immediately.
.Sp
See Test2::Plugin::BailOnFail for complete documentation.
.IP DieOnFail 4
.IX Item "DieOnFail"
The much requested "die on first failure" plugin. When this plugin is
loaded, any failure will cause the test to die immediately.
.Sp
See Test2::Plugin::DieOnFail for complete documentation.
.IP ExitSummary 4
.IX Item "ExitSummary"
This plugin gives you statistics and diagnostics at the end of your test in the
event of a failure.
.Sp
See Test2::Plugin::ExitSummary for complete documentation.
.IP SRand 4
.IX Item "SRand"
Use this to set the random seed to a specific seed, or to the current date.
.Sp
See Test2::Plugin::SRand for complete documentation.
.IP UTF8 4
.IX Item "UTF8"
Turn on utf8 for your testing. This sets the current file to be utf8, it also
sets STDERR, STDOUT, and your formatter to all output utf8.
.Sp
See Test2::Plugin::UTF8 for complete documentation.
.SH "INCLUDED REQUIREMENT CHECKERS"
.IX Header "INCLUDED REQUIREMENT CHECKERS"
.IP AuthorTesting 4
.IX Item "AuthorTesting"
Using this package will cause the test file to be skipped unless the
AUTHOR_TESTING environment variable is set.
.Sp
See Test2::Require::AuthorTesting for complete documentation.
.IP EnvVar 4
.IX Item "EnvVar"
Using this package will cause the test file to be skipped unless a custom
environment variable is set.
.Sp
See Test2::Require::EnvVar for complete documentation.
.IP Fork 4
.IX Item "Fork"
Using this package will cause the test file to be skipped unless the system is
capable of forking (including emulated forking).
.Sp
See Test2::Require::Fork for complete documentation.
.IP RealFork 4
.IX Item "RealFork"
Using this package will cause the test file to be skipped unless the system is
capable of true forking.
.Sp
See Test2::Require::RealFork for complete documentation.
.IP Module 4
.IX Item "Module"
Using this package will cause the test file to be skipped unless the specified
module is installed (and optionally at a minimum version).
.Sp
See Test2::Require::Module for complete documentation.
.IP Perl 4
.IX Item "Perl"
Using this package will cause the test file to be skipped unless the specified
minimum perl version is met.
.Sp
See Test2::Require::Perl for complete documentation.
.IP Threads 4
.IX Item "Threads"
Using this package will cause the test file to be skipped unless the system has
threading enabled.
.Sp
\&\fBNote:\fR This will not turn threading on for you.
.Sp
See Test2::Require::Threads for complete documentation.
.SH "SEE ALSO"
.IX Header "SEE ALSO"
See the Test2 documentation for a namespace map. Everything in this
distribution uses Test2.
.PP
Test2::Manual is the Test2 Manual.
.SH "CONTACTING US"
.IX Header "CONTACTING US"
Many Test2 developers and users lurk on <irc://irc.perl.org/#perl>. We also
have a slack team that can be joined by anyone with an \f(CW\*(C`@cpan.org\*(C'\fR email
address <https://perl\-test2.slack.com/> If you do not have an \f(CW\*(C`@cpan.org\*(C'\fR
email you can ask for a slack invite by emailing Chad Granum
<exodist@cpan.org>.
.SH SOURCE
.IX Header "SOURCE"
The source code repository for Test2\-Suite can be found at
\&\fIhttps://github.com/Test\-More/test\-more/\fR.
.SH MAINTAINERS
.IX Header "MAINTAINERS"
.IP "Chad Granum <exodist@cpan.org>" 4
.IX Item "Chad Granum <exodist@cpan.org>"
.SH AUTHORS
.IX Header "AUTHORS"
.IP "Chad Granum <exodist@cpan.org>" 4
.IX Item "Chad Granum <exodist@cpan.org>"
.SH COPYRIGHT
.IX Header "COPYRIGHT"
Copyright Chad Granum <exodist@cpan.org>.
.PP
This program is free software; you can redistribute it and/or
modify it under the same terms as Perl itself.
.PP
See \fIhttp://dev.perl.org/licenses/\fR
