Test::S...vent::Ok(3)

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

πŸ’– 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 of Test2, Test2::Suite, and Test2::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 to 1 or 0. 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 after TODO, 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 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