2 # Copyright (C) 2006-2009, Parrot Foundation.
7 use lib qw( . lib ../lib ../../lib );
8 use Test::More tests => 1;
9 use Parrot::Distribution;
10 use Parrot::Test::Util::Runloop;
14 t/codingstd/cuddled_else.t - checks for cuddled elses in source and headers
19 % prove t/codingstd/cuddled_else.t
22 % perl t/codingstd/cuddled_else.t src/foo.c include/parrot/bar.h
26 Checks that files do not use cuddled else, that is an else on the same
27 line as the closing brace of the if part.
31 L<docs/pdds/pdd07_codingstd.pod>
35 my $DIST = Parrot::Distribution->new;
36 my @files = @ARGV ? <@ARGV> : (
37 $DIST->get_c_language_files(),
38 $DIST->get_perl_language_files(),
42 Parrot::Test::Util::Runloop->testloop(
43 name => 'no cuddled elses',
45 per_line => sub { $_[0] !~ /}\s*else\s*{/ },
46 diag_prefix => 'Cuddled else found'
51 # cperl-indent-level: 4
54 # vim: expandtab shiftwidth=4: