diff options
| author | Paul Buetow <paul@buetow.org> | 2025-09-28 21:17:35 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2025-09-28 21:17:35 +0300 |
| commit | 99c6f2c1eb084476c9254956ee22872276f4272a (patch) | |
| tree | dd9d72388a278fb30c05b80c1d7bdfb08499be9b /t/04-reporter.t | |
| parent | 2237f95acbc2d078808269eeb77c02aca29a3cfa (diff) | |
fixing stuff
Diffstat (limited to 't/04-reporter.t')
| -rw-r--r-- | t/04-reporter.t | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/t/04-reporter.t b/t/04-reporter.t index 7ed7bd6..1e1299a 100644 --- a/t/04-reporter.t +++ b/t/04-reporter.t @@ -68,4 +68,18 @@ subtest 'gemtext_to_html ascii tables' => sub { is($html, $expected, 'ASCII tables are converted correctly'); }; +subtest 'gemtext_to_html expands truncated URLs' => sub { + Foostats::Reporter::reset_truncated_url_mappings(); + my $original_url = 'https://example.com/a/really/long/path/that/should/get/truncated/because/it/exceeds/the/limit.html'; + my $rows = [ [ $original_url, '12' ] ]; + Foostats::Reporter::truncate_urls_for_table($rows, 'Visitors'); + my $table = Foostats::Reporter::format_table([ 'URL', 'Visitors' ], $rows); + my $gemtext = "```\n$table\n```"; + my $html = Foostats::Reporter::gemtext_to_html($gemtext); + like($html, + qr{<a href=\"https://example.com/a/really/long/path/that/should/get/truncated/because/it/exceeds/the/limit\.html\">https://example.com/a/really/long/path/that/should/get/truncated/because/it/exceeds/the/limit\.html</a>}, + 'HTML renders full URL without ellipsis'); + Foostats::Reporter::reset_truncated_url_mappings(); +}; + done_testing(); |
