Test::Alien::Run(3)

πŸ’… Test::Alien::Run ✨

okay so bestie, you found the manual page for Test::Alien::Run(3) and honestly? it's giving "tiny class, huge main character energy." it's the run object, it holds the receipts on a process, and it's about to make your test output slay. let's get into it 🫢


🌸 NAME 🌸

Test::Alien::Run β€” the Run object, no cap


⭐ VERSION ⭐

version 2.88 β€” yeah, she's been through some things and she's thriving πŸ’–


πŸŽ€ SYNOPSIS πŸŽ€

like, here's the vibe:

use Test2::V0;
use Test::Alien;

run_ok([ $^X, -e => 'print "some output"; exit 22'])
  ->exit_is(22)
  ->out_like(qr{some});

chaining? iconic. obsessed. πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

so this class is basically a little scrapbook πŸŽ€ β€” it stores all the info about a process run, the kind that Test::Alien#run_ok does.

and here's the tea, bestie, listen up: that function is the ONLY way to create an instance of this class. only. one. way. don't try to be cute and build one yourself, that's not the move πŸ™ˆ


🌈 ATTRIBUTES 🌈

out

my $str = $run->out;

the standard output from the run. what it said out loud, basically πŸ—£οΈβœ¨

err

my $str = $run->err;

the standard error from the run. the dramatic whisper-yelling part πŸ’€

exit

my $int = $run->exit;

the exit value of the run. her final answer, periodt.

signal

my $int = $run->signal;

the signal that killed the run β€” or zero if the process got terminated normally. so like, zero means "she left peacefully," anything else means "she was taken out" 😭


πŸ’– METHODS πŸ’–

okay so all of these methods return the run object itself, which means you can chain them like the synopsis showed off up there. chain chain chain 🧚✨

success

$run->success;
$run->success($message);

passes if the process terminated normally with an exit value of 0. that's it, that's the whole vibe check 🫢

exit_is

$run->exit_is($exit);
$run->exit_is($exit, $message);

passes if the process terminated with the given exit value. exactly that number, no substitutions ⭐

exit_isnt

$run->exit_isnt($exit);
$run->exit_isnt($exit, $message);

passes if the process terminated with an exit value of anything but the given value. not that one. literally any other one πŸ’…

out_like

$run->out_like($regex);
$run->out_like($regex, $message);

passes if the output of the run matches the given pattern. regex said yes πŸ”₯

out_unlike

$run->out_unlike($regex);
$run->out_unlike($regex, $message);

passes if the output of the run does not match the given pattern. regex said no thank u πŸ™ˆ

err_like

$run->err_like($regex);
$run->err_like($regex, $message);

passes if the standard error of the run matches the given pattern. the drama matches the script πŸŽ€

err_unlike

$run->err_unlike($regex);
$run->err_unlike($regex, $message);

passes if the standard error of the run does not match the given pattern. plot twist avoided ✨

note

$run->note;

sends the output and standard error as a test note. little diary entry, lowkey πŸ“

diag

$run->diag;

sends the output and standard error as a test diagnostic. same energy, but now it's officially diagnostic πŸ’œ


πŸ‘‘ SEE ALSO πŸ‘‘

  • Test::Alien β€” go read it, bestie, iykyk

πŸ“ AUTHOR πŸ“

Author: Graham Ollis <plicease@cpan.org>

Contributors:

  • Diab Jerius (DJERIUS)
  • Roy Storey (KIWIROY)
  • Ilya Pavlov
  • David Mertens (run4flat)
  • Mark Nunberg (mordy, mnunberg)
  • Christian Walde (Mithaldu)
  • Brian Wightman (MidLifeXis)
  • Zaki Mughal (zmughal)
  • mohawk (mohawk2, ETJ)
  • Vikas N Kumar (vikasnkumar)
  • Flavio Poletti (polettix)
  • Salvador FandiΓ±o (salva)
  • Gianni Ceccarelli (dakkar)
  • Pavel Shaydo (zwon, trinitum)
  • Kang-min Liu (εŠ‰εΊ·ζ°‘, gugod)
  • Nicholas Shipp (nshp)
  • Juan JuliΓ‘n Merelo GuervΓ³s (JJ)
  • Joel Berger (JBERGER)
  • Petr PΓ­saΕ™ (ppisar)
  • Lance Wicks (LANCEW)
  • Ahmad Fatoum (a3f, ATHREEF)
  • JosΓ© JoaquΓ­n Atria (JJATRIA)
  • Duke Leto (LETO)
  • Shoichi Kaji (SKAJI)
  • Shawn Laffan (SLAFFAN)
  • Paul Evans (leonerd, PEVANS)
  • HΓ₯kon HΓ¦gland (hakonhagland, HAKONH)
  • nick nauwelaerts (INPHOBIA)
  • Florian Weimer
  • Marcel Telka (mtelka)

look at that list. a whole squad. the way they all showed up for one little run object?? we love to see it πŸŒˆπŸ‘‘


This software is copyright (c) 2011-2022 by Graham Ollis.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.


and that's the whole page bestie πŸŽ€ this manual page was served up by perl v5.42.3 on 2026-09-21 β€” so go forth, chain those methods, and make your tests ate πŸ’…βœ¨πŸ¦‹

πŸ“¦ where this page comes from