Test::S...vent::Ok(3)
π Test::S...vent::Ok β the manual page, but make it make sense π
okay so bestie, you're looking at the manual page for Test::Stream::Event::Ok from the Perl user-contributed docs, and honestly? it's giving "the event that fires when a test has an opinion." pull up a chair, we're doing this together. π«Ά
β¨ NAME β¨
Test::Stream::Event::Ok β the Ok event type. that's it, that's the name, slay. π
π« DEPRECATED π«
okay so real talk, and I need you to hear me on this one:
this distribution is deprecated in favor ofTest2,Test2::Suite, andTest2::Workflow. it's giving retired icon, ngl. π
if you're tryna convert your whole situation over, peep Test::Stream::Manual::ToTest2 for the conversion guide. it's literally your glow-up roadmap. β¨
πΈ DESCRIPTION πΈ
Ok events get generated whenever you run a test that produces a result. think ok(), think is() β any of those moments where a test is like "here's my verdict bestie." π
π¦ SYNOPSIS π¦
here's the main-character way to do it:
use Test::Stream::Context qw/context/;
use Test::Stream::Event::Ok;
my $ctx = context();
my $event = $ctx->ok($bool, $name, \@diag);
or, if you're feeling spicy and want to go the lowkey route: π₯
my $ctx = debug();
my $event = $ctx->send_event(
'Ok',
pass => $bool,
name => $name,
diag => \@diag
);
π ACCESSORS π
$rb = $e->passβ the original true/false value of whatever got passed into the event, but squished down to1or0. it's not complicated, it just knows what it is. π$name = $e->nameβ the name of the test. the label. the whole identity. β¨$diag = $e->diagβ an arrayref, absolutely stuffed full of diagnostics strings that get printed in the event of a failure. π©Ή
heads up bestie: this does not have anything by default. if you want the basic diagnostics message, use the default_diag() method and push it into this arrayref yourself. no free handouts here, iykyk. π
$b = $e->effective_passβ the true/false value of the test afterTODO,SKIP, and similar modifiers have been taken into account. it's the pass that actually counts. periodt. π$b = $e->allow_bad_nameβ this one relaxes the test name checks so they allow characters that could confuse a TAP parser. chaotic permission slip, fr fr. π
π METHODS π
$string = $e->default_diag()β generates the default diagnostics string, which looks exactly like this:
# Failed test 'Some Test'
# at t/foo.t line 42.
iconic sad-girl output, no cap. π
@sets = $e->to_tap()@sets = $e->to_tap($num)
generates the tap stream for this object. @sets contains 1 or more arrayrefs, and those arrayrefs identify the IO handle to use and the string that should be sent to it. it's giving "package deal." π¦
IO Handle identifiers get set to the value of the Test::Stream::Formatter::TAP OUT_* constants. that's the lore. π§
example, so you can see the vibe:
@sets = (
[OUT_STD() => 'not ok 1 - foo'],
[OUT_ERR() => '# Test 1 Failed ...' ],
...
);
π SOURCE π
the source code repository for Test::Stream lives at http://github.com/Test-More/Test-Stream/. go be nosy, bestie, it's your right. π
π«Ά 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/
and that's the whole page, bestie, we ate and left no crumbs. π this was perl v5.42.0, dated 2025-07-25, from the Test::S...vent::Ok(3) manual page β mwah, go write some passing tests. πβ¨
π¦ 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