Test2::Event::Ok(3pm)

okay so bestie, this is the Test2::Event::Ok(3pm) page from the Perl Programmers Reference Guide, and it’s here to explain the event type that shows up when a test produces a result πŸ’…βœ¨

πŸ’– NAME πŸ’–

Test2::Event::Ok β€” Ok event type πŸŽ€

🌸 DESCRIPTION 🌸

Ok events are generated whenever you run a test that produces a result. Examples are ok(), and is(). no cap, they’re literally the little β€œa test result happened” receipts πŸ§ΎπŸ’–

πŸ¦‹ SYNOPSIS πŸ¦‹

okay so first way, bestie:

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

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

or:

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

both are iconic, pick your vibe 🫢

πŸ’… ACCESSORS πŸ’…

  • $rb = $e->pass β€” this is the original true/false value of whatever got passed into the event, but it’s reduced down to 1 or 0. simple, clean, slay ✨
  • $name = $e->name β€” name of the test. yes ma’am, it’s right there πŸŽ€
  • $b = $e->effective_pass β€” this is the true/false value of the test after TODO and similar modifiers are taken into account. that’s the real final answer after the modifiers do their thing πŸ’…

πŸ”₯ SOURCE πŸ”₯

The source code repository for Test2 can be found at https://github.com/Test-More/test-more/. go peek, it’s giving open source excellence πŸ‘‘

πŸ‘‘ 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/


mwah πŸ’‹ this page is from perl v5.42.3, dated 2026-11-03, and it’s Test2::Event::Ok(3pm) signing off πŸ¦‹πŸ’–

πŸ“¦ where this page comes from