Test2:...::Tiny(3perl)

✨ NAME ✨

Test2::Tools::Tiny β€” the tiniest little toolkit for the unfortunate souls out there who literally cannot use Test2::Suite πŸ˜­πŸ’”


🫢 DESCRIPTION 🫢

okay bestie, real talk: you should actually be using Test2::Suite. like, genuinely. This package is just the bare-minimum essentials implemented using Test2, and it only exists so that Test2 and the other stuff Test2::Suite depends on can get tested. fr fr, this is the package Test2 uses to test itself. it's giving "emergency backup tools," not "main character energy." πŸ’…


πŸ‘‘ USE Test2::Suite INSTEAD πŸ‘‘

Use Test2::Suite if at all possible. that's it, that's the whole section. periodt. ✨


🌸 EXPORTS 🌸

  • ok($bool, $name)
  • ok($bool, $name, @diag)

Run a simple assertion. basic. iconic. no notes. πŸ’–

  • is($got, $want, $name)
  • is($got, $want, $name, @diag)

Assert that 2 strings are the same. twin energy, matching strings only πŸ”₯

  • isnt($got, $do_not_want, $name)
  • isnt($got, $do_not_want, $name, @diag)

Assert that 2 strings are not the same. respectfully, they're different πŸ’€

  • like($got, $regex, $name)
  • like($got, $regex, $name, @diag)

Check that the input string matches the regex. it slays, it fits the pattern πŸŽ€

  • unlike($got, $regex, $name)
  • unlike($got, $regex, $name, @diag)

Check that the input string does not match the regex. wrong vibe, rejected πŸ™ˆ

  • is_deeply($got, $want, $name)
  • is_deeply($got, $want, $name, @diag)

Check 2 data structures.

⚠️ heads up bestie: please note that this is a DUMB implementation that compares the output of Data::Dumper against both structures. no cap, that's genuinely the whole strategy. 🧚
  • diag($msg)

Issue a diagnostics message to STDERR. screaming into the error void πŸ“’

  • note($msg)

Issue a diagnostics message to STDOUT. gentle journaling, but public 🌈

  • skip_all($reason)

Skip all tests. not me dodging the entire suite πŸ’…

  • todo $reason => sub { ... }

Run a block in TODO mode. it's giving "we'll get to it," and honestly that's valid πŸ¦‹

  • plan($count)

Set the plan.

  • done_testing()

Set the plan to the current test count. we're done and we're proud ✨

  • $warnings = warnings { ... }

Capture an arrayref of warnings from the block. hoarding the red flags in an arrayref, as one does πŸ“

  • $exception = exception { ... }

Capture an exception. gotcha, caught you πŸ‘‘

  • tests $name => sub { ... }

Run a subtest. a test inside a test, inception but make it cute 🌸

  • $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/>. go look, it's there, iykyk 🫢


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


okay that's the whole thing bestie, documented and devoured πŸ˜ŒπŸ’… this was perl v5.44.0, dated 2026-10-17, for Test2:...::Tiny(3perl) β€” stay tiny, stay iconic, and please go use Test2::Suite fr fr πŸŽ€βœ¨πŸ¦‹

πŸ“¦ where this page comes from
  • arch rolling: perl 5.44.0-1 Β· Artistic-1.0-Perl AND GPL-1.0-or-later
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms