<commit_before><commit_msg>Receiver: test for TAP archive micro handling<commit_after>#!/usr/bin/env perl

use strict;
use warnings;
use Test::More;
use Artemis::Reports::Receiver;

my $tap_archive = 't/tap-archive-1.tgz';

my $filecontent;
my $FH;
open $FH, "<", $tap_archive and do
{
        local $/;
        $filecontent = <$FH>;
        close $FH;
};

# ------------------------------------------------------------

my $arr = Artemis::Reports::Receiver->new;
$arr->{tap} = $filecontent;
is ($arr->tap_mimetype, 'application/x-gzip', "TAP mimetype - compressed");
is($arr->we_got_taparchive, 1, "TAP archive recognized");

# ------------------------------------------------------------

$arr->{tap} = "1..2
ok
ok
";
is ($arr->tap_mimetype, 'text/plain', "TAP mimetype - text");
is($arr->we_got_taparchive, 0, "TAP text recognized");

# ------------------------------------------------------------

done_testing();
{'fraction_non_alphanumeric': 0.3478735005452563, 'fraction_numerical': 0.0054525627044711015, 'mean_word_length': 1.8867924528301887, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, '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': '1242287', 'n_tokens_mistral': 306, 'n_tokens_neox': 283, 'n_words': 65}