<commit_before>
use strict;
use warnings;

use lib 't/lib/';
use Test::More;
use Data::Dumper;

BEGIN {
    use_ok( 'Bio::EnsEMBL::Hive::Utils', 'load_file_or_module', 'find_submodules' );
}
#########################

my $hive = find_submodules 'Bio::EnsEMBL';
isa_ok($hive, 'ARRAY');
is(@$hive, 1, 'single return');
is($hive->[0], 'Bio::EnsEMBL::Hive', 'found hive');

$hive = find_submodules 'Bio/EnsEMBL';
isa_ok($hive, 'ARRAY');
is(@$hive, 1, 'single return');
is($hive->[0], 'Bio::EnsEMBL::Hive', 'found hive');

my $pipe_configs = find_submodules 'Bio::EnsEMBL::Hive::PipeConfig';
ok($pipe_configs, 'configs found');
isa_ok($pipe_configs, 'ARRAY'); ## still an array
my @sorted_configs = sort { $a cmp $b } @$pipe_configs;
is(@sorted_configs, 13, 'lucky number');
my ($generic) = grep { /HiveGeneric_conf/ } @sorted_configs;
ok($generic, 'found generic base config');

## loading the module

my $module = load_file_or_module( $generic );
is( $module, $generic, 'all good' );

## and by file name ...


done_testing();<commit_msg>There can be more than eHive in PERL5LIB<commit_after>
use strict;
use warnings;

use lib 't/lib/';
use Test::More;
use Data::Dumper;

BEGIN {
    use_ok( 'Bio::EnsEMBL::Hive::Utils', 'load_file_or_module', 'find_submodules' );
}
#########################

my $hive = find_submodules 'Bio::EnsEMBL::Hive';
isa_ok($hive, 'ARRAY');
cmp_ok(scalar(@$hive), '>', 0, 'modules loaded');

my $pipe_configs = find_submodules 'Bio::EnsEMBL::Hive::PipeConfig';
ok($pipe_configs, 'configs found');
isa_ok($pipe_configs, 'ARRAY'); ## still an array
my @sorted_configs = sort { $a cmp $b } @$pipe_configs;
is(@sorted_configs, 13, 'lucky number');
my ($generic) = grep { /HiveGeneric_conf/ } @sorted_configs;
ok($generic, 'found generic base config');

## loading the module

my $module = load_file_or_module( $generic );
is( $module, $generic, 'all good' );

## and by file name ...


done_testing();
{'fraction_non_alphanumeric': 0.21030713170223841, 'fraction_numerical': 0.0052056220718375845, 'mean_word_length': 6.363984674329502, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2841626', 'n_tokens_mistral': 767, 'n_tokens_neox': 736, 'n_words': 177}