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