<commit_before>use v6;

use Test;
plan 5;

use November::Storage::File;

my $s = November::Storage::File.new does Testing;
$s.modifications_path = 't/storage/data/modifications/';

my $id = $s.write_modification([ 'Page', 'Text', 'Author' ]);

ok($id, 'write_modificatin return some id');

my $modif = $s.read_modification($id);

is($modif[0], 'Page', 'read modification data -- Page');
is($modif[1], 'Text', 'read modification data -- Text');
is($modif[2], 'Author', 'read modification data -- Author');
ok($modif[3] <= (int time), 'read time, and it <= now ');

$s.clear;

role Testing {
    method clear {
        run 'rm t/storage/data/modifications/*';
    }
}

# vim:ft=perl6<commit_msg>[p6w] made sure t/storage/modification.t put empty-file back after itself not a very satisfying solution, to be sure<commit_after>use v6;

use Test;
plan 5;

use November::Storage::File;

my $s = November::Storage::File.new does Testing;
$s.modifications_path = 't/storage/data/modifications/';

my $id = $s.write_modification([ 'Page', 'Text', 'Author' ]);

ok($id, 'write_modification returns an id');

my $modif = $s.read_modification($id);

is($modif[0], 'Page', 'read modification data -- Page');
is($modif[1], 'Text', 'read modification data -- Text');
is($modif[2], 'Author', 'read modification data -- Author');
ok($modif[3] <= (int time), 'read time, and it <= now ');

$s.clear;

role Testing {
    method clear {
        run 'rm t/storage/data/modifications/*';
        run 'touch t/storage/data/modifications/empty-file';
    }
}

# vim:ft=perl6
{'fraction_non_alphanumeric': 0.18645161290322582, 'fraction_numerical': 0.00967741935483871, 'mean_word_length': 4.442105263157894, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, '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': '5910501', 'n_tokens_mistral': 554, 'n_tokens_neox': 544, 'n_words': 146}