Test::S...ormatter(3)

πŸ“¦
version 1.302027 Β· 2 versions
, in fedora 43

πŸ’– 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:

  1. the $event object β€” the thing it should record πŸ“
  2. the $assert_num β€” the number of the current assertion (the ok), 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 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