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


Manual Reference Pages  -  TEST::BASE::LESS (3)

.ds Aq ’

NAME

Test::Base::Less - Limited version of Test::Base.

CONTENTS

SYNOPSIS



    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



DESCRIPTION

This is a less clever version of Test::Base.

FUNCTIONS

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.

DEFAULT FILTERS

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.

REGISTER YOUR OWN FILTER

You can register your own filter by following form:



    use Digest::MD5 qw/md5_hex/;
    Test::Base::Less::register_filter(md5_hex => \&md5_hex);



USE CODEREF AS FILTER

You can use a CodeRef as filter.



    use Digest::MD5 qw/md5_hex/;
    filters {
        input => [\&md5_hex],
    };



SEE ALSO

Most of code is taken from Test::Base. Thanks Ingy.
Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 TEST::BASE::LESS (3) 2016-03-18

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