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 of Data::Dumper against both structures.
  • diag($msg) β€” issue a diagnostics message to STDERR.
  • note($msg) β€” issue a diagnostics message to STDOUT.
  • 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 { ... } β€” capture STDOUT and STDERR output.

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 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