Test2::Tools::Tiny(3p)

Test2::Tools::Tiny3p

Tiny set of tools for unfortunate souls who cannot use test2::suite.

Overview

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.

Exports

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 <[email protected]>

Releases

17 releases since OpenBSD 6.5; the text changed 11 times.

  1. 6.5
  2. 6.6
  3. 6.7
  4. 6.8
  5. 6.9–7.2
  6. 7.3
  7. 7.4
  8. 7.5
  9. 7.6
  10. 7.7–7.8
  11. 7.9
  12. 8.0

Authors

Chad Granum <[email protected]>

From man 8.0-current-20261101 in OpenBSD 8.0-current (2026-11-01). Parsed by carta from the page's man source.