Test::Trap 0.0.23
Sponsored Links
Test::Trap 0.0.23 Ranking & Summary
File size:
0.028 MB
Platform:
Any Platform
License:
Perl Artistic License
Price:
Downloads:
810
Date added:
2007-08-06
Publisher:
Eirik Berg Hanssen
Test::Trap 0.0.23 description
Test::Trap is a Perl module with trap exit codes, exceptions, output, etc.
SYNOPSIS
use Test::More;
use Test::Trap qw( trap $trap );
my @r = trap { some_code(@some_parameters) };
is ( $trap->exit, 1, Expecting &some_code to exit with 1 );
is ( $trap->stdout, , Expecting no STDOUT );
like ( $trap->stderr, qr/^Bad parameters; exitingb/, Expecting warnings. );
Primarily (but not exclusively) for use in test scripts: A block eval on steroids, configurable and extensible, but by default trapping (Perl) STDOUT, STDERR, warnings, exceptions, would-be exit codes, and return values from boxed blocks of test code.
The values collected by the latest trap can then be queried or tested through a a special result object.
EXPORT
A function and a scalar may be exported by any name. The function (by default named trap) is an analogue to block eval(), and the scalar (by default named $trap) is the corresponding analogue to $@.
Optionally, you may specify the default layers for the exported trap. Layers may be specified by name, with a colon sigil. Multiple layers may be given in a list, or just stringed together like :flow:stderr:warn.
(For the advanced user, you may also specify anonymous layer implementations -- i.e. an appropriate subroutine.)
See below for a list of the built-in layers, all of which are enabled by default. Note, finally, that the ordering of the layers matter: The :raw layer is always on the bottom (anything underneath it is ignored), and any other "flow control" layers used should be right down there with it.
FUNCTION
trap BLOCK
This function may be exported by any name, but defaults to trap.
Traps exceptions like block eval, but (by default) also traps exits and exit codes, returns and return values, context, and (Perl) STDOUT, STDERR, and warnings, All information trapped can be queried by way of the status object, which is by default exported as $trap, but can be exported by any name.
SYNOPSIS
use Test::More;
use Test::Trap qw( trap $trap );
my @r = trap { some_code(@some_parameters) };
is ( $trap->exit, 1, Expecting &some_code to exit with 1 );
is ( $trap->stdout, , Expecting no STDOUT );
like ( $trap->stderr, qr/^Bad parameters; exitingb/, Expecting warnings. );
Primarily (but not exclusively) for use in test scripts: A block eval on steroids, configurable and extensible, but by default trapping (Perl) STDOUT, STDERR, warnings, exceptions, would-be exit codes, and return values from boxed blocks of test code.
The values collected by the latest trap can then be queried or tested through a a special result object.
EXPORT
A function and a scalar may be exported by any name. The function (by default named trap) is an analogue to block eval(), and the scalar (by default named $trap) is the corresponding analogue to $@.
Optionally, you may specify the default layers for the exported trap. Layers may be specified by name, with a colon sigil. Multiple layers may be given in a list, or just stringed together like :flow:stderr:warn.
(For the advanced user, you may also specify anonymous layer implementations -- i.e. an appropriate subroutine.)
See below for a list of the built-in layers, all of which are enabled by default. Note, finally, that the ordering of the layers matter: The :raw layer is always on the bottom (anything underneath it is ignored), and any other "flow control" layers used should be right down there with it.
FUNCTION
trap BLOCK
This function may be exported by any name, but defaults to trap.
Traps exceptions like block eval, but (by default) also traps exits and exit codes, returns and return values, context, and (Perl) STDOUT, STDERR, and warnings, All information trapped can be queried by way of the status object, which is by default exported as $trap, but can be exported by any name.
Test::Trap 0.0.23 Screenshot
Test::Trap 0.0.23 Keywords
Trap 0.0.23
STDOUT
By default
exit codes
Perl module
May be
trap
exit
default
codes
exceptions
Perl
Test::Trap
TestTrap
Test::Trap 0.0.23
Libraries
Bookmark Test::Trap 0.0.23
Test::Trap 0.0.23 Copyright
WareSeeker periodically updates pricing and software information of Test::Trap 0.0.23 full version from the publisher, so some information may be slightly out-of-date. You should confirm all information before relying on it. Software piracy is theft, Using crack, password, serial numbers, registration codes, key generators is illegal and prevent future development of Test::Trap 0.0.23 Edition. Download links are directly from our publisher sites, torrent files or links from rapidshare.com, yousendit.com or megaupload.com are not allowed
Featured Software
Want to place your software product here?
Please contact us for consideration.
Contact WareSeeker.com
Related Information
count on me by default
task scheduler exit codes
by default definition
exit codes unix
count on me lyrics by default
by default
cell text is placed ____.
scheduled task exit codes
lyrics to count on me by default
exit codes bash
country exit codes
trapped miners
exite
wasting my time by default
may beach
by default
which device uses irq 6
default mail client
divorce by default
wolf trap
Related Software
Test::Litmus is a Perl module to submit test results to the Litmus testcase management tool. Free Download
Test::Version is a Perl module that has the role to check for VERSION information in modules. Free Download
Acme::Tests is a Perl module to see how much do you know. Free Download
Test::Simple is a Perl module with basic utilities for writing tests. Free Download
Iterator::IO is a Perl module with filesystem and stream iterators. Free Download
Test::Tester::CaptureRunner is a Perl module that provides help testing test modules built with Test::Builder. Free Download
Test::Data is a Perl module to test functions for particular variable types. Free Download
CPAN::Test::Others is a Perl module to include tests for other modules on CPAN. Free Download
Latest Software
Popular Software
Favourite Software