TEST2::FORMATTER::TAP(3perl)

✨ NAME ✨

Test2::Formatter::TAP β€” the Standard TAP formatter, bestie πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

Okay so this is the thing that takes your events and turns them into TAP. That's it. That's the whole job. It's giving translator, it's giving glow-up for your test output. ✨


🌸 SYNOPSIS 🌸

use Test2::Formatter::TAP;
my $tap = Test2::Formatter::TAP->new();

# Switch to utf8
$tap->encoding('utf8');

$tap->write($event, $number); # Output an event

πŸ’– METHODS πŸ’–

  • $bool = $tap->no_numbers
  • $tap->set_no_numbers($bool)

Use this to turn the numbers on and off. Little toggle moment, we love a switch. 🎚️

  • $arrayref = $tap->handles
  • $tap->set_handles(\@handles);

Can be used to get/set the filehandles. The indexes are identified by the OUT_STD and OUT_ERR constants β€” so like, if you're lost, those constants are your map. πŸ—ΊοΈ

  • $encoding = $tap->encoding
  • $tap->encoding($encoding)

Get or set the encoding. By default no encoding is set, and the original settings of STDOUT and STDERR are used.

Heads up bestie: this directly modifies the stored filehandles. It does not create new ones. No new filehandles were harmed in the making of this encoding. πŸ’€
  • $tap->write($e, $num)

Write an event to the console. Slay. πŸ‘‘


πŸŽ€ SOURCE πŸŽ€

The source code repository for Test2 can be found at <https://github.com/Test-More/test-more/>.


πŸ‘‘ MAINTAINERS πŸ‘‘

Chad Granum <exodist@cpan.org>


🫢 AUTHORS 🫢

Chad Granum <exodist@cpan.org>

Kent Fredric <kentnl@cpan.org>


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/>


That's the whole page, periodt. πŸ’œ Brought to you by perl v5.44.0, dated 2026-10-17 β€” no cap, fr fr. πŸ“πŸ§š

πŸ“¦ 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