##############################################################################
# $URL: http://perlcritic.tigris.org/svn/perlcritic/trunk/distributions/Perl-Critic/t/Modules/RequireVersionVar.run $
# $Date: 2011-04-01 15:24:20 -0700 (Fri, 01 Apr 2011) $
# $Author: wyant $
# $Revision: 4062 $
##############################################################################
## name No code
## failures 1
## cut
#Nothing!
#-----------------------------------------------------------------------------
## name basic pass
## failures 0
## cut
our $VERSION = 1.0;
#-----------------------------------------------------------------------------
## name basic pass #2
## failures 0
## cut
our ($VERSION) = 1.0;
#-----------------------------------------------------------------------------
## name basic pass #3
## failures 0
## cut
$Package::VERSION = 1.0;
#-----------------------------------------------------------------------------
## name basic pass #4
## failures 0
## cut
use vars '$VERSION';
#-----------------------------------------------------------------------------
## name basic pass #5
## failures 0
## cut
use vars qw($VERSION);
#-----------------------------------------------------------------------------
## name fail with lexical
## failures 1
## cut
my $VERSION;
#-----------------------------------------------------------------------------
## name fail with wrong variable
## failures 1
## cut
our $Version;
#-----------------------------------------------------------------------------
## name pass with "no critic" on
## failures 0
## cut
#!anything ## no critic (RequireVersionVar)
#-----------------------------------------------------------------------------
## name Readonly VERSION
## failures 0
## cut
Readonly our $VERSION = 1.0;
#-----------------------------------------------------------------------------
## name Readonly::Scalar VERSION
## failures 0
## cut
Readonly::Scalar our $VERSION = 1.0;
#-----------------------------------------------------------------------------
## name Readonly::Scalar VERSION
## failures 1
## cut
Readonly::Scalar my $VERSION = 1.0; #Note this is lexical
#-----------------------------------------------------------------------------
## name Version as argument to package. RT #67159
## failures 0
## cut
package Foo 0.001;
#-----------------------------------------------------------------------------
## name Package without version should still be violation. RT #67159
## failures 1
## cut
package Foo;
##############################################################################
# Local Variables:
# mode: cperl
# cperl-indent-level: 4
# fill-column: 78
# indent-tabs-mode: nil
# c-indentation-style: bsd
# End:
# ex: set ts=8 sts=4 sw=4 tw=78 ft=perl expandtab shiftround :