Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Detects unused variables
Perl
Branch: master

Checking in changes prior to tagging of version 0.005.

Changelog diff is:

diff --git a/Changes b/Changes
index 9a469b6..fff0215 100644
--- a/Changes
+++ b/Changes
@@ -2,6 +2,9 @@ Revision history for Perl extension Test::Vars

 {{$NEXT}}

+0.005 2013-05-31T02:04:42Z
+    - Use skip_all instead of planning 0 tests (#4)
+
 0.004 2013-05-05T13:48:11Z
     - Remove an unnecessary use of smart match operator
latest commit d6d267968e
@gfx authored
Failed to load latest commit information.
example
lib/Test
t
xt
.gitignore
.travis.yml
Build.PL
Changes
LICENSE
META.json
README.md
cpanfile

README.md

NAME

Test::Vars - Detects unused variables

VERSION

This document describes Test::Vars version 0.005.

SYNOPSIS

use Test::Vars;

all_vars_ok(); # check libs in MANIFEST

DESCRIPTION

Test::Vars finds unused variables in order to keep the source code tidy.

INTERFACE

Exported

all_vars_ok(%args)

Tests libraries in your distribution with %args.

libraries are collected from the MANIFEST file.

If you want to ignore variables, for example $foo, you can tell it to the test routines:

  • ignore_vars => { '$foo' => 1 }
  • ignore_vars => [qw($foo)]
  • ignore_if => sub{ $_ eq '$foo' }

Note that $self will be ignored by default unless you pass explicitly { '$self' => 0 } to ignore_vars.

vars_ok($lib, %args)

Tests $lib with %args.

See all_vars_ok.

MECHANISM

Test::Vars is similar to a part of Test::Perl::Critic,but the mechanism is different.

While Perl::Critic, the backend of Test::Perl::Critic, scans the source code as texts, this modules scans the compiled opcode (or AST: abstract syntax tree) using the B module. See also B and its submodules.

CONFIGURATION

TEST_VERBOSE = 1 | 2 shows the way this module works.

CAVEATS

https://rt.cpan.org/Ticket/Display.html?id=60018

https://rt.cpan.org/Ticket/Display.html?id=82411

DEPENDENCIES

Perl 5.10.0 or later.

BUGS

All complex software has bugs lurking in it, and this module is no exception. If you find a bug please either email me, or add the bug to cpan-RT.

SEE ALSO

Perl::Critic

warnings::unused

B

Test::Builder::Module

AUTHOR

Goro Fuji (gfx)

LICENSE AND COPYRIGHT

Copyright (c) 2010, Goro Fuji (gfx). All rights reserved.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic for details.

Something went wrong with that request. Please try again.