<commit_before><?php

declare(strict_types=1);

namespace Inphest\MetaTests;

use Inphest\Assert;
use Inphest\Internal\TimeFormatter;
use function Inphest\test;

test(
    'times are formatted correctly',
    static function (Assert $assert, string $expected, int $nanoseconds): void {
        $assert->same($expected, TimeFormatter::format($nanoseconds));
    }
)->with([
    ['0ms', 0],
    ['1ms', 1_000_000],
    ['99ms', 99_000_000],
    ['999ms', 999_000_000],
    ['1s', 1_000_000_000],
    ['59s', 59_000_000_000],
    ['59s 99ms', 59_099_000_000],
    ['59s 999ms', 59_999_000_000],
    ['1m', 60_000_000_000],
    ['10m', 600_000_000_000],
    ['12m 34s 56ms', 754_056_000_000],
    ['11m 11s 999ms', 671_999_000_000],
]);<commit_msg>Improve labels in time formatter meta test<commit_after><?php

declare(strict_types=1);

namespace Inphest\MetaTests;

use Inphest\Assert;
use Inphest\Internal\TimeFormatter;
use function Inphest\test;

test(
    'times are formatted correctly',
    static function (Assert $assert, string $expected, int $nanoseconds): void {
        $assert->same($expected, TimeFormatter::format($nanoseconds));
    }
)->with([
    '0ms' => ['0ms', 0],
    '1ms' => ['1ms', 1_000_000],
    '99ms' => ['99ms', 99_000_000],
    '999ms' => ['999ms', 999_000_000],
    '1s' => ['1s', 1_000_000_000],
    '59s' => ['59s', 59_000_000_000],
    '59s 99ms' => ['59s 99ms', 59_099_000_000],
    '59s 999ms' => ['59s 999ms', 59_999_000_000],
    '1m' => ['1m', 60_000_000_000],
    '10m' => ['10m', 600_000_000_000],
    '12m 34s 56ms' => ['12m 34s 56ms', 754_056_000_000],
    '11m 11s 999ms' => ['11m 11s 999ms', 671_999_000_000],
]);
{'fraction_non_alphanumeric': 0.17995169082125603, 'fraction_numerical': 0.20350241545893719, 'mean_word_length': 4.26031746031746, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 19, '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': '1342496', 'n_tokens_mistral': 901, 'n_tokens_neox': 658, 'n_words': 140}