<commit_before>#!/usr/bin/env perl

use strict;
use warnings;

use Test::More tests => 5;

BEGIN { use_ok( 'Artemis::MCP::Info' ); }


my $info = Artemis::MCP::Info->new();
isa_ok($info, 'Artemis::MCP::Info', 'Created object');


my $timeout = 10;
$info->add_prc(0, $timeout);
my $received = $info->get_boot_timeout(0);
is($received, $timeout, 'Add PRC and get its boot timeout');

$info->add_testprogram(3, 20);
$info->add_testprogram(3, 10);
$info->add_testprogram(3, 5);
$info->add_testprogram(3, 30);
my @received_list = $info->get_testprogram_timeouts(3);
is_deeply(\@received_list, [20, 10, 5, 30], 'Setting and getting testprogram timeouts');
is($info->get_prc_count(), 3, 'Get PRC count');<commit_msg>MCP: Info unit test uses new API now<commit_after>#!/usr/bin/env perl

use strict;
use warnings;

use Test::More tests => 5;

BEGIN { use_ok( 'Artemis::MCP::Info' ); }


my $info = Artemis::MCP::Info->new();
isa_ok($info, 'Artemis::MCP::Info', 'Created object');


my $timeout = 10;
$info->add_prc(0, $timeout);
my $received = $info->get_boot_timeout(0);
is($received, $timeout, 'Add PRC and get its boot timeout');

$info->add_testprogram(3, {timeout => 20, name => "foo", argv => ['--bar']});
$info->add_testprogram(3, {timeout => 10, name => "foo", argv => ['--bar']});
$info->add_testprogram(3, {timeout =>  5, name => "foo", argv => ['--bar']});
$info->add_testprogram(3, {timeout => 30, name => "foo", argv => ['--bar']});
my @received_list = $info->get_testprogram_timeouts(3);
is_deeply(\@received_list, [20, 10, 5, 30], 'Setting and getting testprogram timeouts');
is($info->get_prc_count(), 3, 'Get PRC count');
{'fraction_non_alphanumeric': 0.21779141104294478, 'fraction_numerical': 0.03067484662576687, 'mean_word_length': 6.0606060606060606, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 35, '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': '3997371', 'n_tokens_mistral': 664, 'n_tokens_neox': 608, 'n_words': 152}