The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Test::Subtests - Different kinds of subtests.

VERSION

Version 0.01

SYNOPSIS

Different kinds of tests, that allow for some subtests to fail.

use Test::More;
use Test::Subtests;

one_of  'one_of fail'  => sub { ok(1); ok(1); ok(0); };
one_of  'one_of pass'  => sub { ok(1); ok(0); ok(0); };

none_of 'none_of fail' => sub { ok(1); ok(1); ok(0); };
none_of 'none_of pass' => sub { ok(0); ok(0); ok(0); };

some_of 'some_of fail' => sub { ok(0); ok(0); ok(0); };
some_of 'some_of pass' => sub { ok(1); ok(1); ok(0); };

all_of  'all_of fail'  => sub { ok(1); ok(1); ok(0); };
all_of  'all_of pass'  => sub { ok(1); ok(1); ok(1); };

most_of 'most_of fail' => sub { ok(1); ok(0); ok(0); };
most_of 'most_of pass' => sub { ok(1); ok(1); ok(0); };

ignore  'ignore pass'  => sub { ok(0); ok(0); ok(0); };
ignore  'ignore pass'  => sub { ok(1); ok(1); ok(0); };

EXPORT

  • one_of

  • none_of

  • some_of

  • all_of

  • most_of

  • ignore

FUNCTIONS

one_of NAME, CODE

Test that passes if exactly one subtest passes.

none_of NAME, CODE

Test that passes if all subtests fail.

some_of NAME, CODE

Test that passes if at least one subtest passes.

all_of NAME, CODE

Test that passes if all subtests pass.

(Basically the same as subtest.)

most_of NAME, CODE

Test that passes if more subtests pass than fail.

ignore NAME, CODE

Test that ignores the results of the subtests. It always passes.

AUTHOR

Bert Vanderbauwhede, <batlock666 at gmail.com>

BUGS

Please report any bugs or feature requests to bug-test-subtests at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Test-Subtests. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

You can find documentation for this module with the perldoc command.

perldoc Test::Subtests

You can also look for information at:

LICENSE AND COPYRIGHT

Copyright 2014 Bert Vanderbauwhede.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

See http://www.gnu.org/licenses/ for more information.