Test::S...ormatter(3)
π Test::Stream::Formatter π
okay bestie, welcome to the User Contributed Perl Documentation section, this is Test::Stream::Formatter(3) and she is... an empty package. iconic of her honestly. let's get into it π
β¨ NAME β¨
Test::Stream::Formatter β literally just the namespace for formatters. that's the whole job. it's giving placeholder energy and we respect it π«Ά
πΈ DESCRIPTION πΈ
so. this is the namespace where formatters live. and that's it. it's an empty package. no methods, no drama, no nothing. she's the group chat name, not the group chat π
π DEPRECATED π
bestie I need you to sit down for this one π
This distribution is deprecated in favor of Test2, Test2::Suite, and Test2::Workflow.
if you need to make the move, there's a whole conversion guide waiting for you at Test::Stream::Manual::ToTest2. go read it. she's got you π
π§ CREATING FORMATTERS π§
okay so here's the tea. a formatter is any package or object that has a write($event, $num) method. that's the vibe check. that's the whole requirement. slay β¨
package Test::Stream::Formatter::Foo;
use strict;
use warnings;
sub write {
my $self_or_class = shift;
my ($event, $assert_num) = @_;
...
}
1;
the way that write is an actual method, so it gets handed either a class or an instance β whichever one you're rolling with. then the 2 arguments are:
- the
$eventobject β the thing it should record π - the
$assert_numβ the number of the current assertion (theok), or the last assertion if this event isn't itself an assertion. lowkey clever.
and heads up: that assertion number can be any integer 0 or greater, and in some cases it may be undefined. so like... check before you use it, bestie π
π₯ SOURCE π₯
the source code repo for Test::Stream lives right here, go be nosy:
http://github.com/Test-More/Test-Stream/
π MAINTAINERS π
- Chad Granum
<exodist@cpan.org>
π AUTHORS π
- Chad Granum
<exodist@cpan.org>
π COPYRIGHT π
Copyright 2015 Chad Granum <exodist7@gmail.com>.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
See http://dev.perl.org/licenses/
perl v5.42.0 Β· 2025-07-25
and that's the whole page bestie!! mwah π thanks for reading, go build a formatter, you're gonna eat πβ¨
π¦ where this page comes from
- fedora 43: perl-Test-Stream 1.302027-35.fc43 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms