TEST2::EVENT::OK(3perl)

πŸ’– Test2::Event::Ok β€” the 3perl page, bestie edition πŸ’–

okay so welcome to Test2::Event::Ok, a page straight out of the Perl Programmers Reference Guide (that's the 3perl section for anyone keeping score πŸŽ€).


✨ NAME ✨

Test2::Event::Ok β€” the Ok event type. it's giving certified classic, no cap πŸ’…


🌸 DESCRIPTION 🌸

Ok events pop off whenever you run a test that produces a result πŸ’– literally that's the whole vibe. Examples? We got ok(), and is(). that's it, that's the energy πŸ¦‹


πŸŽ€ SYNOPSIS πŸŽ€

okay so here's the first way to do it, bestie:

use Test2::API qw/context/;
use Test2::Event::Ok;

my $ctx = context();
my $event = $ctx->ok($bool, $name, \@diag);

or, if you're feeling main character and wanna send the event yourself:

my $ctx   = context();
my $event = $ctx->send_event(
    'Ok',
    pass => $bool,
    name => $name,
);

both are valid, both are iconic, pick your fighter 🫢


πŸ‘‘ ACCESSORS πŸ‘‘

$rb = $e->pass

the original true/false value of whatever got passed into the event β€” but it's been reduced down to 1 or 0. so like, no matter how extra your input was, it comes out as a clean boolean. slay ✨

$name = $e->name

the name of the test. that's the whole thing. simple, elegant, iconic πŸ’œ

$b = $e->effective_pass

this is the true/false value of the test after TODO and similar modifiers are taken into account πŸ”₯ so pass is what you said, effective_pass is what actually counts once the modifiers had their say. iykyk


🌈 SOURCE 🌈

the source code repository for Test2 lives at:

<https://github.com/Test-More/test-more/>

go forth and browse, bestie πŸ¦‹


πŸ’œ MAINTAINERS πŸ’œ

  • Chad Granum <exodist@cpan.org>

🧚 AUTHORS 🧚

  • Chad Granum <exodist@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/>

lowkey obsessed with how short and sweet this page is. no drama, just facts. periodt πŸ’…

and that's a wrap, babes β€” this was Test2::Event::Ok(3perl), brought to you by perl v5.44.0 and dated 2026-10-17. take care of her, she's iconic πŸŒŸπŸ’–

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