GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Test::Base::Less(3) User Contributed Perl Documentation Test::Base::Less(3)

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(+{ } : HashRef);
    filters {
        input => [qw/eval/],
    };
    

Set a filter for the section name.

blocks()
Get a list of Text::TestBase::Block as filtered.
register_filter($name: Str, $code: CodeRef)
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
eval() the code.
chomp
"chomp()" the arguments.
uc
"uc()" the arguments.
trim
Remove extra blank lines from the beginning and end of the data. This allows you to visually separate your test data with blank lines.
lines
Break the data into an anonymous array of lines. Each line (except possibly the last one if the chomp filter came first) will have a newline at the end.

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.
2022-04-09 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.