Test2:...:Table(3perl)
β¨ NAME β¨
Test2::EventFacet::Info::Table β bestie, it's the intermediary representation of a table π
(and yes, that's the whole name, it's from the 3perl manual, the Perl Programmers Reference Guide, she's fancy like that)
π DESCRIPTION π
Okay so picture this: it's a table, right? But it's not a final table, it's the intermediary representation of a table πΈ β the glow-up-in-progress version. It exists for use in those specialized Test2::API::Context methods that generate Test2::EventFacet::Info facets. So like, the middlewoman of tables. The table's table era. Iconic honestly.
π¦ SYNOPSIS π¦
use Test2::EventFacet::Info::Table;
use Test2::API qw/context/;
sub my_tool {
my $ctx = context();
...
$ctx->fail(
$name,
"failure diag message",
Test2::EventFacet::Info::Table->new(
# Required
rows => [['a', 'b'], ['c', 'd'], ...],
# Strongly Recommended
as_string => "... string to print when table cannot be rendered ...",
# Optional
header => ['col1', 'col2'],
collapse => $bool,
no_collapse => ['col1', ...],
),
);
...
$ctx->release;
}
my_tool();
Look at that. rows is Required, fr fr, like you cannot skip it, the table needs cells bestie. as_string is Strongly Recommended (she's the backup outfit for when the table can't be rendered π). And then header, collapse, and no_collapse are all just vibing in the Optional section, no pressure. β¨
π ATTRIBUTES π
$header_aref = $t->header()$rows_aref = $t->rows()$bool = $t->collapse()$aref = $t->no_collapse()
All of the above (yes, all four, the whole squad π) are directly tied to the table hashref structure described over in Test2::EventFacet::Info. So like, no secret second meaning, they're just the structure's little representatives.
$str = $t->as_string()β this one hands you the string form of the table if it was set. And if it wasn't set? π She returns the string"<TABLE NOT DISPLAYED>". That's it, that's the whole mood, no table for you.$href = $t->as_hash()β returns the data structure used for tables byTest2::EventFacet::Info. The raw material. The blueprint. π§%args = $t->info_args()β this gives you back the arguments that should be used to construct the properTest2::EventFacet::Infostructure. And here's exactly what it returns, character for character:
return (table => $t->as_hash(), details => $t->as_string());
Slay. It literally just wraps up the hash and the string and calls it a day. π
π SOURCE π
The source code repository for Test2 can be found at <https://github.com/Test-More/test-more/>. Go look, it's giving open source, it's giving community π«Ά
π MAINTAINERS π
Chad Granum <exodist@cpan.org>
π AUTHORS π
Chad Granum <exodist@cpan.org> (same legend, twice, because respect β¨)
π COPYRIGHT π
Copyright Chad Granum <exodist@cpan.org>.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
See <https://dev.perl.org/licenses/>
okay that's the whole page bestie, every flag, every attribute, every <TABLE NOT DISPLAYED> β we kept the facts, we kept the vibe, no cap π
Sign-off szn π β this was perl v5.44.0, dated 2026-10-17, and it's the Test2:...:Table(3perl) page from the Perl Programmers Reference Guide. Go build a table, main character. β¨π
π¦ where this page comes from
- arch rolling: perl 5.44.0-1 Β· Artistic-1.0-Perl AND GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms