Test2::...::Table(3)
This is the Test2::...::Table(3) page from User Contributed Perl Documentation β and yes bestie, we're making this table representation arc make sense. π«Ά
πΈ NAME πΈ
Test2::EventFacet::Info::Table β Intermediary representation of a table.
β¨ DESCRIPTION β¨
Okay so this is the in-between representation of a table, for use in specialized Test2::API::Context methods which generate Test2::EventFacet::Info facets. It's the little table middle-man, and it ate. π
π¦ 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();
π ATTRIBUTES π
$header_aref = $t->header()β gives you the header aref.$rows_aref = $t->rows()β gives you the rows aref.$bool = $t->collapse()β gives you the collapse bool.$aref = $t->no_collapse()β gives you the no_collapse aref.
The above are all directly tied to the table hashref structure described in Test2::EventFacet::Info. Ik, they're a little squad. π
$str = $t->as_string()β returns the string form of the table if it was set. Otherwise it returns the string"<TABLE NOT DISPLAYED>". No cap, that's the fallback. π$href = $t->as_hash()β returns the data structure used for tables byTest2::EventFacet::Info.%args = $t->info_args()β returns the arguments that should be used to construct the properTest2::EventFacet::Infostructure. It's giving helper method excellence. β¨
return (table => $t->as_hash(), details => $t->as_string());
π SOURCE π
The source code repository for Test2 can be found at <https://github.com/Test-More/test-more/>. Go off, repo. π«Ά
π MAINTAINERS π
Chad Granum <exodist@cpan.org>
π§ AUTHORS π§
Chad Granum <exodist@cpan.org>
π 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/>.
Final sign-off bestie: this page is from perl v5.42.0, dated 2025-07-28, and it's the Test2::...::Table(3) page. Bye! π«Άβ¨
π¦ where this page comes from
- opensuse-leap 16.0: perl-Test-Simple 1.302214-bp160.1.2 Β· Artistic-1.0 OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms