|
Line 0
Link Here
|
| 0 |
- |
1 |
#!/usr/bin/perl |
|
|
2 |
use Modern::Perl; |
| 3 |
use Test::PerlTidy; |
| 4 |
use Test::More; |
| 5 |
use Test::NoWarnings; |
| 6 |
|
| 7 |
use Koha::Devel::Files; |
| 8 |
|
| 9 |
my $dev_files = Koha::Devel::Files->new( { context => 'all' } ); |
| 10 |
my @files; |
| 11 |
push @files, $dev_files->ls_perl_files; |
| 12 |
push @files, $dev_files->ls_tt_files; |
| 13 |
push @files, $dev_files->ls_js_files; |
| 14 |
push @files, $dev_files->ls_yml_files; |
| 15 |
push @files, $dev_files->ls_css_files; |
| 16 |
|
| 17 |
#plan tests => scalar @files + 1; |
| 18 |
plan tests => scalar @files; |
| 19 |
|
| 20 |
for my $file (@files) { |
| 21 |
if ( -z $file ) { |
| 22 |
|
| 23 |
# File is empty |
| 24 |
ok(1); |
| 25 |
next; |
| 26 |
} |
| 27 |
open my $fh, '<', $file or die "Can't open file ($file): $!"; |
| 28 |
seek $fh, -1, 2 or die "Can't seek ($file): $!"; |
| 29 |
read $fh, my $char, 1; |
| 30 |
close $fh; |
| 31 |
is( $char, "\n", "$file should end with a new line" ); |
| 32 |
} |