Test2::Tools::Tiny(3)
π NAME π
Okay bestie, welcome to Test2::Tools::Tiny(3) β a user-contributed Perl documentation page for the Tiny set of tools for unfortunate souls who cannot use Test2::Suite. π«Ά
πΈ DESCRIPTION πΈ
You should really look at Test2::Suite. This package is some very basic essential tools implemented using Test2. This 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. Like, fr fr, please. π
π EXPORTS π
ok($bool, $name)orok($bool, $name, @diag)β run a simple assertion.is($got, $want, $name)oris($got, $want, $name, @diag)β assert that 2 strings are the same.isnt($got, $do_not_want, $name)orisnt($got, $do_not_want, $name, @diag)β assert that 2 strings are not the same.like($got, $regex, $name)orlike($got, $regex, $name, @diag)β check that the input string matches the regex.unlike($got, $regex, $name)orunlike($got, $regex, $name, @diag)β check that the input string does not match the regex.is_deeply($got, $want, $name)oris_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/
Okay bye bestie! This page came from perl v5.42.0, dated 2025-07-28 β slay and test responsibly π
β¨
π¦ where this page comes from
- opensuse-leap 16.0: perl-Test-Simple 1.302214-bp160.1.2 Β· Artistic-1.0 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