<commit_before>package TestUtils;

use 5.012;
use Moose;
use File::Temp;
use Cwd;
use namespace::autoclean;
use Data::Dump qw(dd);

has destroy => (
    traits    => ['Bool'],
    is        => 'rw',
    isa       => 'Bool',
    default   => 0,
    );

has build_proper => (
    traits    => ['Bool'],
    is        => 'rw',
    isa       => 'Bool',
    default   => 0,
    );

has build_problematic => (
    traits    => ['Bool'],
    is        => 'ro',
    isa       => 'Bool',
    default   => 0,
    );

has build_all => (
    traits    => ['Bool'],
    is        => 'ro',
    isa       => 'Bool',
    default   => 0,
    );

sub fasta_constructor {
    my ($self) = @_;
    if ($self->build_all) {
	my $proper_fa = $self->_build_proper_fa_data;
	my $problematic_fa = $self->_build_problematic_fa_data;
	if ($self->destroy) {
	    unlink $proper_fa;
	    unlink $problematic_fa;
	}
	else {
	    return [ $proper_fa, $problematic_fa ];
	}
    }<commit_msg>add loading of role to generate config<commit_after>package TestUtils;

use 5.012;
use Moose;
use MooseX::Types::Path::Class;
use File::Temp;
use Cwd;
use namespace::autoclean;
#use Data::Dump qw(dd);

with 'TestUtils::TestConfig';

has 'destroy' => (
    traits    => ['Bool'],
    is        => 'rw',
    isa       => 'Bool',
    default   => 0,
    );

has 'build_proper' => (
    traits    => ['Bool'],
    is        => 'rw',
    isa       => 'Bool',
    default   => 0,
    );

has 'build_problematic' => (
    traits    => ['Bool'],
    is        => 'ro',
    isa       => 'Bool',
    default   => 0,
    );

has 'build_all' => (
    traits    => ['Bool'],
    is        => 'ro',
    isa       => 'Bool',
    default   => 0,
    );

sub fasta_constructor {
    my ($self) = @_;
    if ($self->build_all) {
	my $proper_fa = $self->_build_proper_fa_data;
	my $problematic_fa = $self->_build_problematic_fa_data;
	if ($self->destroy) {
	    unlink $proper_fa;
	    unlink $problematic_fa;
	}
	else {
	    return [ $proper_fa, $problematic_fa ];
	}
    }
{'fraction_non_alphanumeric': 0.17337307501241928, 'fraction_numerical': 0.007948335817188276, 'mean_word_length': 2.156739811912226, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 51, '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': '4182765', 'n_tokens_mistral': 776, 'n_tokens_neox': 728, 'n_words': 164}