Test2::Tools::Tiny(3) User Contributed Perl Documentation Test2::Tools::Tiny(3)

# [NAME](#NAME)

Test2::Tools::Tiny - Tiny set of tools for unfortunate souls who cannot use Test2::Suite.

# [DESCRIPTION](#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_INSTEAD)

Use Test2::Suite if at all possible.

# [EXPORTS](#EXPORTS)

[ok($bool, $name)](#ok%28$bool,)

[ok($bool, $name, @diag)](#ok%28$bool,~2)

Run a simple assertion.

[is($got, $want, $name)](#is%28$got,)

[is($got, $want, $name, @diag)](#is%28$got,~2)

Assert that 2 strings are the same.

[isnt($got, $do\_not\_want, $name)](#isnt%28$got,)

[isnt($got, $do\_not\_want, $name, @diag)](#isnt%28$got,~2)

Assert that 2 strings are not the same.

[like($got, $regex, $name)](#like%28$got,)

[like($got, $regex, $name, @diag)](#like%28$got,~2)

Check that the input string matches the regex.

[unlike($got, $regex, $name)](#unlike%28$got,)

[unlike($got, $regex, $name, @diag)](#unlike%28$got,~2)

Check that the input string does not match the regex.

[is\_deeply($got, $want, $name)](#is_deeply%28$got,)

[is\_deeply($got, $want, $name, @diag)](#is_deeply%28$got,~2)

Check 2 data structures. Please note that this is a *DUMB* implementation that compares the output of Data::Dumper against both structures.

[diag($msg)](#diag%28$msg%29)

Issue a diagnostics message to STDERR.

[note($msg)](#note%28$msg%29)

Issue a diagnostics message to STDOUT.

[skip\_all($reason)](#skip_all%28$reason%29)

Skip all tests.

[todo $reason =&gt; sub { ... }](#todo)

Run a block in TODO mode.

[plan($count)](#plan%28$count%29)

Set the plan.

[**done\_testing()**](#done_testing%28%29)

Set the plan to the current test count.

Returns the number of assertions that were made, which is 0 when none were.

$warnings = warnings { ... }

Capture an arrayref of warnings from the block.

$exception = exception { ... }

Capture an exception.

[tests $name =&gt; sub { ... }](#tests)

Run a subtest.

$output = capture { ... }

Capture STDOUT and STDERR output.

Result looks like this:

```
    {
        STDOUT => "...",
        STDERR => "...",
    }
    
```

# [SOURCE](#SOURCE)

The source code repository for Test2 can be found at &lt;https://github.com/Test-More/test-more/&gt;.

# [MAINTAINERS](#MAINTAINERS)

[Chad Granum &lt;exodist@cpan.org&gt;](#Chad)

# [AUTHORS](#AUTHORS)

[Chad Granum &lt;exodist@cpan.org&gt;](#Chad~2)

# [COPYRIGHT](#COPYRIGHT)

Copyright Chad Granum &lt;exodist@cpan.org&gt;.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

See &lt;https://dev.perl.org/licenses/&gt;

2026-10-26 perl v5.44.0

---

Document: Test2::Tools::Tiny(3pm) from perl-test-simple 1.302226-r2 (Chainguard OS)
Source: https://github.com/Test-More/test-more
