-
-
18 Sep 2019 01:23:16 UTC
- Distribution: vars-i
- Source (raw)
- Browse (raw)
- Changes
- Homepage
- How to Contribute
- Repository
- Issues (0)
- Testers (1605 / 0 / 0)
- Kwalitee
Bus factor: 1- 100.00% Coverage
- License: perl_5
- Perl: v5.6.1
- Activity
24 month- Tools
- Download (16.92KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
NAME
Kit - vars::i test kit
SYNOPSIS
Test helpers. These make it easier to trap undefined variables using string eval and
use strict
.FUNCTIONS
eval_dies_ok
eval_dies_ok "Code string" [, "message"];
Runs the code string; tests that the code died. Any exception will be reported at the same line in the caller as the
eval_dies_ok
invocation.eval_lives_ok
eval_lives_ok "Code string" [, "message"];
Runs the code string; tests that the code did not throw an exception.
eval_dies_like
eval_dies_like "Code string", qr/regex/ [, "message"];
Runs the code string; tests that the code threw an exception matching
regex
.eval_is_var
eval_is_var '$Package::var', value [, "message"];
Tests that
$Package::var
exists, and that$Package::var eq value
.line_mark_string
Add a
#line
directive to a string. Usage:my $str = line_mark_string <<EOT ; $contents EOT
or
my $str = line_mark_string __FILE__, __LINE__, <<EOT ; $contents EOT
In the first form, information from
caller
will be used for the filename and line number.The
#line
directive will point to the line after theline_mark_string
invocation, i.e., the first line of <C$contents>. Generally,$contents
will be source code, although this is not required.$contents
must be defined, but can be empty.import
Exports the functions using Exporter --- all functions are exported by default. Also loads Test::More into the caller.
Module Install Instructions
To install vars::i, copy and paste the appropriate command in to your terminal.
cpanm vars::i
perl -MCPAN -e shell install vars::i
For more information on module installation, please visit the detailed CPAN module installation guide.