TEST2::TOOLS::TINY(3pm)
π Test2::Tools::Tiny(3pm) π
hey bestie, welcome to Test2::Tools::Tiny(3pm) from the Perl Programmers Reference Guide β this is the tiny little toolbox page, and yes, it has main character energy despite being tiny.
πΈ NAME πΈ
Test2::Tools::Tiny β tiny set of tools for unfortunate souls who cannot use Test2::Suite.
π¦ DESCRIPTION π¦
okay so real talk: you should really look at Test2::Suite.
This package is some very basic essential tools implemented using Test2. It exists only so that Test2 and other tools required by Test2::Suite can be tested. This is the package Test2 uses to test itself.
π USE Test2::Suite INSTEAD π
Use Test2::Suite if at all possible. That's the vibe. No cap.
β¨ EXPORTS β¨
here's the whole tiny toolbox, bestie β every signature stays exactly as it is:
ok($bool, $name)/ok($bool, $name, @diag)β run a simple assertion.is($got, $want, $name)/is($got, $want, $name, @diag)β assert that 2 strings are the same.isnt($got, $do_not_want, $name)/isnt($got, $do_not_want, $name, @diag)β assert that 2 strings are not the same.like($got, $regex, $name)/like($got, $regex, $name, @diag)β check that the input string matches the regex.unlike($got, $regex, $name)/unlike($got, $regex, $name, @diag)β check that the input string does not match the regex.is_deeply($got, $want, $name)/is_deeply($got, $want, $name, @diag)β check 2 data structures. please note that this is a DUMB implementation that compares the output ofData::Dumperagainst both structures.diag($msg)β issue a diagnostics message toSTDERR.note($msg)β issue a diagnostics message toSTDOUT.skip_all($reason)β skip all tests.todo $reason => sub { ... }β run a block in TODO mode.plan($count)β set the plan.done_testing()β set the plan to the current test count.$warnings = warnings { ... }β capture an arrayref of warnings from the block.$exception = exception { ... }β capture an exception.tests $name => sub { ... }β run a subtest.$output = capture { ... }β captureSTDOUTandSTDERRoutput.
result looks like this:
{
STDOUT => "...",
STDERR => "...",
}
π SOURCE π
The source code repository for Test2 can be found at <https://github.com/Test-More/test-more/>.
π MAINTAINERS π
Chad Granum <exodist@cpan.org>
π AUTHORS π
Chad Granum <exodist@cpan.org>
π COPYRIGHT π
Copyright Chad Granum <exodist@cpan.org>.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
See <https://dev.perl.org/licenses/>
footer vibes, bestie: this page is perl v5.42.3, dated 2026-11-03, and it's Test2::Tools::Tiny(3pm) β byeee π«Άπ
π¦ where this page comes from
- alpine 3.24: perl-doc 5.42.3-r0 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms