X-Git-Url: http://git.maemo.org/git/?p=dh-make-perl;a=blobdiff_plain;f=dev%2Farm%2Flibperl-critic-perl%2Flibperl-critic-perl-1.088%2Ft%2FNamingConventions%2FProhibitAmbiguousNames.run;fp=dev%2Farm%2Flibperl-critic-perl%2Flibperl-critic-perl-1.088%2Ft%2FNamingConventions%2FProhibitAmbiguousNames.run;h=9bfd32f38968cda433306f42784e51b9fca7b302;hp=0000000000000000000000000000000000000000;hb=f477fa73365d491991707e7ed9217b48d6994551;hpb=da95c414033799c3a62606f299c3c00b5c77ca11 diff --git a/dev/arm/libperl-critic-perl/libperl-critic-perl-1.088/t/NamingConventions/ProhibitAmbiguousNames.run b/dev/arm/libperl-critic-perl/libperl-critic-perl-1.088/t/NamingConventions/ProhibitAmbiguousNames.run new file mode 100644 index 0000000..9bfd32f --- /dev/null +++ b/dev/arm/libperl-critic-perl/libperl-critic-perl-1.088/t/NamingConventions/ProhibitAmbiguousNames.run @@ -0,0 +1,110 @@ +## name Basic failures. +## failures 11 +## cut + +my $left = 1; # scalar +my @right = ('foo'); # array +our $no = undef; # our +my %abstract; # hash +local *main::contract; # pkg prefix on var +sub record {} # sub +my ($second, $close); # catch both of these +sub pkg::bases {} # pkg prefix on sub +my ($last, $set); + +#----------------------------------------------------------------------------- + +## name Ambiguous word in compound name. +## TODO False negative: Ambiguous words in compound names should be forbidden +## failures 2 +## cut + +my $last_record; +my $first_record; + +#----------------------------------------------------------------------------- + +## name Basic passes. +## failures 0 +## cut + +for my $bases () {} +print $main::contract; +my %hash = (left => 1, center => 'right'); +sub no_left_turn {} +local $\; # for Devel::Cover; an example of a var declaration without \w + +#----------------------------------------------------------------------------- + +## name Ambiguous name on rhs. +## TODO False positive: Need to distinguish rhs in variable statements +## failures 0 +## cut + +my ($foo) = ($left); + +#----------------------------------------------------------------------------- + +## name Ambiguous, but exempt by convention +## failures 0 +## cut + +no warnings; +close $fh; + +#----------------------------------------------------------------------------- + +## name Custom null configuration +## parms { forbid => q{} } +## failures 0 +## cut + +my $left; +my $close; +END_PERL + +#----------------------------------------------------------------------------- + +## name Custom configuration: "foo bar baz quux" +## parms { forbid => 'foo bar baz quux' } +## failures 2 +## cut + +my $left; +my $close; +my $foo; +my $bar; + +#----------------------------------------------------------------------------- + +## name Custom configuration: "foo bar baz quux" +## parms { forbid => 'foo bar left close' } +## failures 4 +## cut + +my $left; +my $close; +my $foo; +my $bar; + +#%config = ( forbid => join q{ }, qw(foo bar baz quux), @default ); + +#----------------------------------------------------------------------------- + +## name Custom null configuration +## parms { forbid => undef } +## failures 2 +## cut + +my $left; +my $close; + +#----------------------------------------------------------------------------- +# 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 :