manpagez: man pages & more
man Test2::Tools::Tiny(3)
Home | html | info | man
Test2::Tools::Tiny(3pm)Perl Programmers Reference GuideTest2::Tools::Tiny(3pm)


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


       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.


       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.

           Issue a diagnostics message to STDERR.

           Issue a diagnostics message to STDOUT.

           Skip all tests.

       todo $reason => sub { ... }
           Run a block in TODO mode.

           Set the plan.

           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 => "...",


       The source code repository for Test2 can be found at


       Chad Granum <>


       Chad Granum <>


       Copyright 2016 Chad Granum <>.

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


perl v5.26.1                      2017-07-18           Test2::Tools::Tiny(3pm)

perl 5.26.1 - Generated Wed Nov 8 15:00:39 CST 2017
© 2000-2018
Individual documents may contain additional copyright information.