1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111
|
## name Basic failure
## failures 2
## cut
@list = ('foo', 'bar', 'baz-bot');
@list = ('foo',
'bar',
'baz-bot');
#-----------------------------------------------------------------------------
## name Non-word lists
## failures 0
## cut
@list = ('3/4', '-123', '#@$%');
@list = ('3/4',
'-123',
'#@$%');
#-----------------------------------------------------------------------------
## name Basic passing
## failures 0
## cut
('foo');
@list = ();
@list = ('foo');
@list = ('foo', 'bar', 'bee baz');
@list = ('foo', 'bar', q{bee baz});
@list = ('foo', 'bar', q{});
@list = ('foo', 'bar', 1.0);
@list = ('foo', 'bar', 'foo'.'bar');
@list = ($foo, 'bar', 'baz');
@list = (foo => 'bar');
%hash = ('foo' => 'bar', 'fo' => 'fum');
my_function('foo', 'bar', 'fudge');
&my_function('foo', 'bar', 'fudge');
$an_object->a_method('foo', 'bar', 'fudge');
$a_sub_routine_ref->('foo', 'bar', 'fudge');
foreach ('foo', 'bar', 'nuts'){ do_something($_) }
#-----------------------------------------------------------------------------
## name Three elements with minimum set to four
## failures 0
## parms {min_elements => 4}
## cut
@list = ('foo', 'bar', 'baz');
#-----------------------------------------------------------------------------
## name Four elements with minimum set to four
## failures 1
## parms {min_elements => 4}
## cut
@list = ('foo', 'bar', 'baz', 'nuts');
#-----------------------------------------------------------------------------
## name Failing 'use' statements
## failures 1
## cut
use Foo ('foo', 'bar', 'baz');
#-----------------------------------------------------------------------------
## name Passing 'use' statements
## failures 0
## cut
use Foo ();
use Foo ('foo', 1, 'bar', '1/2');
use Foo ('foo' => 'bar', 'baz' => 'nuts');
## name Non-word lists in strict mode.
## failures 3
## parms { strict => 1 }
## cut
use Foo ('foo', 'bar', '1/2');
@list = ('3/4', '-123', '#@$%');
@list = ('3/4',
'-123',
'#@$%');
#-----------------------------------------------------------------------------
##############################################################################
# $URL: http://perlcritic.tigris.org/svn/perlcritic/trunk/distributions/Perl-Critic/t/CodeLayout/ProhibitQuotedWordLists.run $
# $Date: 2009-02-15 10:57:40 -0600 (Sun, 15 Feb 2009) $
# $Author: clonezone $
# $Revision: 3115 $
##############################################################################
# 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 :
|