Main Koha release repository
https://koha-community.org
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
706 B
27 lines
706 B
#!/usr/bin/perl
|
|
#
|
|
# Tests usage of deprecated Perl syntax. Deprecated could be extended to the
|
|
# sense of 'not allowed'.
|
|
#
|
|
use warnings;
|
|
use strict;
|
|
use Test::More tests => 1;
|
|
use File::Find;
|
|
use Cwd;
|
|
|
|
my @files_with_switch = do {
|
|
my @files;
|
|
local $/ = undef;
|
|
find( sub {
|
|
my $dir = getcwd();
|
|
return if $dir =~ /blib/;
|
|
return unless /\.(pl|pm)$/; # Don't inspect non-Perl files
|
|
open my $fh, "<", $_;
|
|
my $content = <$fh>;
|
|
push @files, "$dir/$_" if $content =~ /switch\s*\(.*{/;
|
|
}, ( '.' ) );
|
|
@files;
|
|
};
|
|
ok( !@files_with_switch, "Perl syntax: no use of switch statement" )
|
|
or diag( "Files list: " . join(', ', @files_with_switch) );
|
|
|
|
|