Test::S...ception(3)

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

✨ NAME ✨

Test::Stream::Event::Exception β€” the exception event, bestie πŸ’–

It lives in the Test::Stream::Event::Exception family and it's literally just the event that shows up when stuff breaks. That's it. That's the whole vibe. 🫢


πŸ’€ DEPRECATED πŸ’€

okay so first things first, and I need you to hear me on this one:

This distribution is DEPRECATED. Not like "old and quirky" deprecated, like actually deprecated. It got replaced by Test2, Test2::Suite, and Test2::Workflow. πŸ‘‘

If you're sitting here like "wait, how do I move my whole thing over to the new hotness," there's a whole conversion guide waiting for you: see Test::Stream::Manual::ToTest2. Go read it, it's giving helpful. πŸ“–βœ¨


🌸 DESCRIPTION 🌸

So when an exception event happens, two things go down, and both of them are kind of a big deal:

  1. It will display to STDERR β€” like, out loud, in your terminal, for everyone to see. 😭
  2. It will prevent the overall test file from passing. Not just the one test. The whole file. The vibe check has been failed. πŸ’€

πŸ¦‹ SYNOPSIS πŸ¦‹

here's the moment you've been waiting for, the actual code, no cap:

use Test::Stream::Context qw/context/;
use Test::Stream::Event::Exception;

my $ctx = context();
my $event = $ctx->send_event('Exception', error => 'Stuff is broken');

see how it's just... 'Stuff is broken'? iconic. raw. honest. πŸ’…


πŸŽ€ METHODS πŸŽ€

It inherits from Test::Stream::Event (so everything that one can do, this one can do too β€” generational talent fr fr). On top of that, it also defines this one:

  • $reason = $e->error β€” this hands you back the reason for the exception. like, the actual why. the lore. the backstory. πŸ“

πŸ”₯ SOURCE πŸ”₯

Wanna go look at the actual source code? Respect. The repo for Test::Stream lives right here:

http://github.com/Test-More/Test-Stream/

go forth and scroll, bestie. 🧚


πŸ‘‘ MAINTAINERS πŸ‘‘

  • Chad Granum <exodist@cpan.org>

🌈 AUTHORS 🌈

  • Chad Granum <exodist@cpan.org>

(yes it's the same person in both lists, and honestly? that's main character energy. one legend carrying the whole thing. πŸ‘‘βœ¨)


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/


okay that's the whole page, no skips, no skimming, every single flag and name and email preserved exactly as the ancestors intended 🫢

this has been Test::Stream::Event::Exception from perl v5.42.0, 2025-07-25, as documented under Test::S...ception(3) β€” mwah, bye bestie! πŸ’–πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from