perl-Test-Class-WithStrictPlan-0.1-alt1.noarch.rpm


Advertisement

Description

perl-Test-Class-WithStrictPlan - Test::Class with exact and strict plan

Property Value
Distribution ALT Linux Sisyphus
Repository Autoimports noarch
Package name perl-Test-Class-WithStrictPlan
Package version 0.1
Package release alt1
Package architecture noarch
Package type rpm
Installed size 4.70 KB
Download size 4.70 KB
Official Mirror ftp.altlinux.org
*Test::Class::WithStrictPlan* is an extension of the
*Test::Class* module. It has exactly the same API,
methods and behavior with just one difference in what the plan number
specified in `Test' attribute means.
In *Test::Class* it means the maximal number of tests
for a correspondent method; in *Test::Class::WithStrictPlan* it means
strictly the exact number of tests (not more, not less).
The following example demonstrates the difference the best: it uses
*Test::Class* but contains an incorrect pattern in
the test code.
package Example1;
use parent 'Test::Class';
use Test::More;
sub test1 : Test(3) {
is(1 + 1, 2);
is(2 + 2, 4);
}
__PACKAGE__->runtests;
The plan specifies 3 tests, but only 2 are defined. When this test
is run it passes without any error.
1..3
ok 1 - test1
ok 2 - test1
ok 3 # skip 1
Why? Because the plan means the maximal number of tests which can be
run and the number of tests which were run is not more than 3.
Are you interested in what the `1' means after the `# skip' output
string? It is the return value of the `test1' method. When a lower
number of tests is run than specified in *Test::Class*
then the return value of the test method is used as the reason to skip
the remaining tests. In this case the value of the last statement is
returned (the return value of the `is' call). To provide no skip
reason it is needed to return `undef' from the test method.
In most cases one wants to specify the exact number of tests instead
of the maximal number. It also prevents problems like the one in the
above incorrect example. And for this purposes there is the
*Test::Class::WithStrictPlan* module in which a plan means the exact
number of specified tests.
See the above module rewritten to use *Test::Class::WithStrictPlan*.
package Example2;
use parent 'Test::Class::WithStrictPlan';
use Test::More;
sub test1 : Test(3) {
is(1 + 1, 2);
is(2 + 2, 4);
}
__PACKAGE__->runtests;
When this is run then it fails and shows an error as one would expe...

Alternatives

Package Version Architecture Repository
perl-Test-Class-WithStrictPlan - - -

Requires

Name Value
/usr/share/perl5 -
perl(Attribute/Handlers.pm) -
perl(Test/Class.pm) >= 0.370
perl(attributes.pm) -
perl(parent.pm) -
rpmlib(PayloadIsLzma) -

Provides

Name Value
perl(Test/Class/WithStrictPlan.pm) = 0.100
perl-Test-Class-WithStrictPlan = 0.1-alt1

Download

Type URL
Binary Package perl-Test-Class-WithStrictPlan-0.1-alt1.noarch.rpm
Source Package perl-Test-Class-WithStrictPlan-0.1-alt1.src.rpm

Install Howto

  1. Add the following line to /etc/apt/sources.list:
    
    rpm [Sisyphus] http://ftp.altlinux.org/pub/distributions/ALTLinux/autoimports/Sisyphus noarch autoimports
    rpm [Sisyphus] http://ftp.altlinux.org/pub/distributions/ALTLinux/autoimports/Sisyphus noarch autoimports
    
  2. Update the package index:
    # sudo apt-get update
  3. Install perl-Test-Class-WithStrictPlan rpm package:
    # sudo apt-get install perl-Test-Class-WithStrictPlan

Files

Path
/usr/share/doc/perl-Test-Class-WithStrictPlan-0.1/Changes
/usr/share/doc/perl-Test-Class-WithStrictPlan-0.1/README
/usr/share/perl5/Test/
/usr/share/perl5/Test/Class/WithStrictPlan.pm

See Also

Package Description
perl-Test-Classy-0.10-alt1_3.noarch.rpm Write your unit tests in other modules than *.t
perl-Test-Clear-0.04-alt1.noarch.rpm Simply testing module
perl-Test-Clustericious-Blocking-0.07-alt1.noarch.rpm Run blocking code in a process using an unholy combination of forks and Mojolicious
perl-Test-Clustericious-Cluster-0.33-alt1.noarch.rpm Test an imaginary beowulf cluster of Clustericious services
perl-Test-Cmd-1.09-alt1_9.noarch.rpm Perl module for portable testing of commands and scripts
perl-Test-Collectd-Plugins-0.1009-alt1.noarch.rpm Common out-of-band collectd plugin test suite
perl-Test-Command-0.11-alt1_9.noarch.rpm Test routines for external commands
perl-Test-Command-Simple-0.05-alt2.noarch.rpm Test external commands (nearly) as easily as loaded modules
perl-Test-Common-0.07-alt1.noarch.rpm Simple, Reusable Module Tests
perl-Test-Common-scripts-0.07-alt1.noarch.rpm Test-Common scripts
perl-Test-CompanionClasses-1.101370-alt1.noarch.rpm Run tests defined in companion classes
perl-Test-Compiles-0.001-alt1.noarch.rpm tests if perl can compile a string of code
perl-Test-Conditions-0.83-alt1.noarch.rpm test multiple conditions across a large data structure or list in a simple and compact way
perl-Test-Config-System-0.63-alt1.noarch.rpm System configuration related unit tests
perl-Test-Consul-0.012-alt1.noarch.rpm Run a consul server for testing
Advertisement
Advertisement