<commit_before>use strict;
use warnings;

use Test::More;
use FindBin;

my $script = $FindBin::RealBin."/../bin/bcgTree.pl";
ok(-f $script, "bcgTree.pl exists");

done_testing();<commit_msg>add test for error message if file is not found<commit_after>use strict;
use warnings;

use Test::More;
use FindBin;

my $script = $FindBin::RealBin."/../bin/bcgTree.pl";
ok(-f $script, "bcgTree.pl exists");

# Test with non existent file path
my $result = qx($script --proteome bla=non_existent_file.fasta 2>&1);
ok($?, "Script finishes with error code if fasta file does not exist.");
ok($result =~ /File not found/, "Error message contains text 'File not found' if fasta file does not exist.");

done_testing();
{'fraction_non_alphanumeric': 0.1534090909090909, 'fraction_numerical': 0.002840909090909091, 'mean_word_length': 4.97457627118644, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '167590', 'n_tokens_mistral': 239, 'n_tokens_neox': 235, 'n_words': 81}