Test::Base::Less - Limited version of Test::Base.
use Test::Base::Less; filters { input => [qw/eval/], }; for my $block (blocks) { is($block->input, $block->expected); } done_testing; __DATA__ === --- input: 4*2 --- expected: 8
This is a less clever version of Test::Base.
This module exports all Test::More's exportable functions, and following functions:
filters { input => [qw/eval/], };
Set a filter for the section name.
Get a list of Text::TestBase::Block as filtered.
Register a filter for $name using $code.
This module provides only few filters. If you want to add more filters, pull-reqs welcome. (I only merge a patch using no depended modules)
eval() the code.
chomp() the arguments.
chomp()
uc() the arguments.
uc()
Remove extra blank lines from the beginning and end of the data. This allows you to visually separate your test data with blank lines.
You can register your own filter by following form:
use Digest::MD5 qw/md5_hex/; Test::Base::Less::register_filter(md5_hex => \&md5_hex);
You can use a CodeRef as filter.
use Digest::MD5 qw/md5_hex/; filters { input => [\&md5_hex], };
Most of code is taken from Test::Base. Thanks Ingy.
To install Text::TestBase, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Text::TestBase
CPAN shell
perl -MCPAN -e shell install Text::TestBase
For more information on module installation, please visit the detailed CPAN module installation guide.