Test2::...::Table(3pm)
Test2::...::Table(3pm) β hey bestie, this is the page from the Perl Programmers Reference Guide, and itβs all about Test2::EventFacet::Info::Table. Letβs get into it π
πΈ NAME πΈ
Test2::EventFacet::Info::Table β intermediary representation of a table. Periodt.
π¦ DESCRIPTION π¦
Okay so this is the intermediary representation of a table, bestie β it exists for use in specialized Test::API::Context methods that generate Test2::EventFacet::Info facets. Thatβs the whole vibe: a middle layer that helps those methods produce info facets. No cap.
β¨ SYNOPSIS β¨
Hereβs the exact synopsis, copy-paste core and all:
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()β grabs the header aref, bestie.$rows_aref = $t->rows()β grabs the rows aref.$bool = $t->collapse()β the collapse boolean situation.$aref = $t->no_collapse()β the no-collapse aref.
All four of the above are directly tied to the table hashref structure described in Test2::EventFacet::Info. Thatβs the link-up, iykyk.
$str = $t->as_string()β returns the string form of the table if it was set; otherwise it returns the string"<TABLE NOT DISPLAYED>". The way that fallback is literally iconic π$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. And the actual return is:
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 look, bestie π«Ά
π 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/>.
okay thatβs the whole manual page, bestie! π
Footer tea: perl v5.42.3, dated 2026-11-03 β mwah, go slay your tables π«Άβ¨
π¦ where this page comes from
- alpine 3.24: perl-doc 5.42.3-r0 Β· Artistic-1.0-Perl 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