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



NAME

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


DESCRIPTION

You should really look at the Test2::Suite manpage. This package is some very basic essential tools implemented using the Test2 manpage. This exists only so that the Test2 manpage and other tools required by the Test2::Suite manpage can be tested. This is the package the Test2 manpage uses to test itself.


USE Test2::Suite INSTEAD

Use the Test2::Suite manpage 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 the Data::Dumper manpage 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 http://github.com/Test-More/test-more/.


MAINTAINERS

Chad Granum <exodist@cpan.org>


AUTHORS

Chad Granum <exodist@cpan.org>


COPYRIGHT

Copyright 2019 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 http://dev.perl.org/licenses/

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