Skip to content
Snippets Groups Projects
Commit 6f91e9bf authored by Alessandro Vullo's avatar Alessandro Vullo
Browse files

Tests for subroutines in the Bio::EnsEMBL::Utils::IO module.

Added just a test for the new method filter_dir at the moment.
parent b89945ae
No related branches found
No related tags found
No related merge requests found
################################################
# #
# io.t #
# #
# A set of tests to verify various subroutines #
# in the Bio::EnsEMBL::Utils::IO module #
# #
################################################
use strict;
use warnings;
use Test::More;
use File::Temp;
use Bio::EnsEMBL::Utils::IO qw /:all/;
ok(1, 'module compiles');
#
# test filtering the content of a directory
#
my $tmpdir = File::Temp->newdir();
my $dirname = $tmpdir->dirname;
my $perl_tmp_file1 = File::Temp->new(DIR => $dirname,
SUFFIX => '.pl');
my $perl_tmp_file2 = File::Temp->new(DIR => $dirname,
SUFFIX => '.pl');
my $perl_tmp_file3 = File::Temp->new(DIR => $dirname,
SUFFIX => '.pl');
my $other_tmp_file1 = File::Temp->new(DIR => $dirname,
SUFFIX => '.dat');
my $other_tmp_file2 = File::Temp->new(DIR => $dirname,
SUFFIX => '.dat');
is(scalar @{Bio::EnsEMBL::Utils::IO::filter_dir($dirname, sub {
my $file = shift;
return $file if $file =~ /\.pl$/;
})}, 3, "filter_dir: number of entries in dir");
done_testing();
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment