Login
Remove column numbers from =over POD directives. The POD formatter
[gknop/Perl-Critic.git] / t / NamingConventions / Capitalization.run
CommitLineData
1a33d0ae
ES
1## name Basic Passes
2## failures 0
3## cut
4
5my $foo;
6our $bar;
7my($foo, $bar) = ("BLEH", "BLEH");
8my @foo;
9my %bar;
10sub foo {}
11
12my $foo123;
13my $foo123bar;
14sub foo123 {}
15sub foo123bar {}
16
17my $fooBar; # camelCase is ok
18my $fooBAR;
19sub fooBar {}
20sub fooBAR {}
21
22my $CONSTANT;
23
24package This::SomeThing;
25package This;
26package This::Thing;
27package Acme::12345;
28package YYZ;
29
30#-----------------------------------------------------------------------------
31
32## name Basic Failures
33## failures 14
34## cut
35
36my $Foo;
37our $Bar;
38my @Foo;
39my %Bar;
40sub Foo {}
41
42my $foo_Bar;
43sub foo_Bar {}
44
45my $FooBar;
46sub FooBar {}
47
48my $foo123Bar;
49sub foo123Bar {}
50
51package pragma;
52package Foo::baz;
53package baz::FooBar;
54
55#-----------------------------------------------------------------------------
56
c86a4fc6
CD
57## name Special case: main
58## failures 0
59## cut
60
61package main;
62
63#-----------------------------------------------------------------------------
64
1a33d0ae
ES
65## name Combined passes and fails
66## failures 2
67## cut
68
69my($foo, $Bar);
70our($Bar, $foo);
71
72#-----------------------------------------------------------------------------
73
74## name Variables from other packages should pass
75## failures 0
76## cut
77
78local $Other::Package::Foo;
79$Other::Package::Foo;
80
81#-----------------------------------------------------------------------------
82
83## name Only cares about declarations
84## failures 0
85## cut
86Foo();
87$Foo = 42;
88
89#-----------------------------------------------------------------------------
90
91## name Constants must be all caps, passes
92## failures 0
93## cut
94
95Readonly::Scalar my $CONSTANT = 23;
96
97#-----------------------------------------------------------------------------
98
99## name Constants must be all caps, failures
100## TODO Detect whether a scalar is constant or not
101## failures 4
102## cut
103
104Readonly::Scalar my $Foo = 23;
105Readonly::Scalar my $foo = 23;
106Readonly::Scalar my $fooBAR = 23;
107my $CONSTANT = 23;
108
109
110#-----------------------------------------------------------------------------
111# Local Variables:
112# mode: cperl
113# cperl-indent-level: 4
114# fill-column: 78
115# indent-tabs-mode: nil
116# c-indentation-style: bsd
117# End:
118# ex: set ts=8 sts=4 sw=4 tw=78 ft=perl expandtab shiftround :