24 Mar 2021 03:09:35 UTC
- Distribution: Perl-Critic
- Module version: 1.140
- Source (raw)
- Browse (raw)
- How to Contribute
- Clone git repository
- Testers (1766 / 3 / 0)
- KwaliteeBus factor: 2
- 90.11% Coverage
- License: perl_5
- Perl: v5.6.1
- Activity24 month
- Download (635.2KB)
- MetaCPAN Explorer
- Subscribe to distribution
- This version
- Latest version++ed by:54 non-PAUSE usersPETDANCE Andy Lesterand 1 contributors
- Jeffrey Thalhammer
- and possibly others
- Reverse dependencies
- CPAN Testers List
- Dependency graph
Perl::Critic::Policy::TestingAndDebugging::RequireTestLabels - Tests should all have labels.
This Policy is part of the core Perl::Critic distribution.
Most Perl modules with regression tests use Test::More as infrastructure for writing and running those tests. It has an easy, procedural syntax for writing comparisons of results to expectations.
Most of the Test::More functions allow the programmer to add an optional label that describes what each test is trying to judge. When a test goes wrong, these labels are very useful for quickly determining where the problem originated.
This policy enforces that all Test::More functions have labels where applicable. This only applies to code that has a
require Test::Moredeclaration (see below to add more test modules to the list).
A list of additional modules to require label parameters be passed to their methods can be specified with the
modulesoption. The list must consist of whitespace-delimited, fully-qualified module names. For example:
[TestingAndDebugging::RequireTestLabels] modules = My::Test::SubClass Some::Other::Module
The module list always implicitly includes Test::More.
Chris Dolan <email@example.com>
Copyright (c) 2006-2011 Chris Dolan.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.