<commit_before>use v6;
use Test;
use lib "{$?FILE.IO.dirname}/data";
use Text::Markdown::Discount;
use TextMarkdownDiscountTestBoilerplate;

{
    my $result = Text::Markdown::Discount.from-str(q:to/END/);
        % Delectus velit quo
        % <NAME>
        % 2017-08-15T00:18:36.850Z
        content
        END

    is $result.title,  'Delectus velit quo';
    is $result.author, '<NAME>';
    is $result.date,   '2017-08-15T00:18:36.850Z';
    is $result.to-str, '<p>content</p>';
}

done-testing;<commit_msg>Add a test for fetching nonexistent headers<commit_after>use v6;
use Test;
use lib "{$?FILE.IO.dirname}/data";
use Text::Markdown::Discount;
use TextMarkdownDiscountTestBoilerplate;

{
    my $result = Text::Markdown::Discount.from-str(q:to/END/);
        % Delectus velit quo
        % <NAME>
        % 2017-08-15T00:18:36.850Z
        content
        END

    is $result.title,  'Delectus velit quo';
    is $result.author, '<NAME>';
    is $result.date,   '2017-08-15T00:18:36.850Z';
    is $result.to-str, '<p>content</p>';
}

{
    my $result = Text::Markdown::Discount.from-str(q:to/END/);
        content with no headers
        END

    is $result.title,  Str;
    is $result.author, Str;
    is $result.date,   Str;
    is $result.to-str, '<p>content with no headers</p>';
}

done-testing;
{'fraction_non_alphanumeric': 0.16158536585365854, 'fraction_numerical': 0.053353658536585365, 'mean_word_length': 2.8846153846153846, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, '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': '2789450', 'n_tokens_mistral': 544, 'n_tokens_neox': 490, 'n_words': 100}