Test::S...w::Unit(3)
π NAME π
Test::Stream::Workflow::Unit β bestie, it's literally the representation of a workflow unit. one unit of work. that's her whole vibe π
π EXPERIMENTAL CODE WARNING π
okay so. "This module is still EXPERIMENTAL". Test-Stream is now stable, but this particular module is still experimental. You are still free to use this module, but you have been warned that it may change in backwords incompatible ways. This message will be removed from this modules POD once it is considered stable.
not me warning you twice but like... the vibes are unstable, babes π
π DEPRECATED π
This distribution is deprecated in favor of Test2, Test2::Suite, and Test2::Workflow.
See Test::Stream::Manual::ToTest2 for a conversion guide. (that's your glow-up roadmap, iykyk β¨)
πΈ DESCRIPTION πΈ
This package is a single unit of work to be done in a workflow. The unit may contain a codeblock, or many child units. it's giving "one little task with a whole friend group" π«Ά
β¨ METHODS β¨
$bool = $unit->contains($name)$bool = $unit->contains($line)$bool = $unit->contains("$file $line)β Check if the unit contains (or is) a unit with the given specification. The specification may be a line number, a filename + line number, or a unit name. This will return true if either the unit, or one of the child units, matches. so basically a vibe check but for units π$unit->add_modify($other_unit)$unit->add_buildup($other_unit)$unit->add_teardown($other_unit)β These add$other_unitas a child unit. The child is added to the group specified in the method name. (the method name IS the group, no guessing required, periodt)$unit->add_primary($other_unit)β Add a primary unit child. Note: The primary unit is either an arrayref of other units, or a single coderef. In cases where the primary is a coderef, this will fail badly.
bestie this will fail badly. like, dramatically. not a drill π
$unit->add_post(sub { ... })β Add a post-build callback.$unit->do_post()β Run (and remove) the post-build callbacks. they don't stick around, they ate and left π$dbg = $unit->debugβ Generate anTest::Stream::Debugobject for this unit.$ctx = $unit->contextβ Generate a context representing the scope of the unit. Note: this context is non-canonical.$name = $unit->nameβ Get the unit name.$hr = $unit->metaβ Get the meta hashref, this contains things like'todo'and'skip'.$type = $unit->typeβ Get the unit type.$bool = $unit->wrapβ True if the codeblock for this unit is a wrap (around_all,around_each, etc).$hr = $unit->stashβ General purpose stash for use in plugins and extensions. it's the junk drawer but make it β¨intentionalβ¨$pkg = $unit->packageβ Package for the unit.$file = $unit->fileβ Filename for the unit$start = $unit->start_lineβ Starting line for the unit.$end = $unit->end_lineβ Ending line number for the unit. Note: This can be set to an integer, or to the string'EOF'.$unit->adjust_linesβ This will check all child unit bounds, if they fall outside the parents bounds then the parent will be adjusted. mom unit stretches to fit her kids, iconic π$ar = $unit->post$ar = $unit->modify$ar = $unit->buildup$ar = $unit->teardownβ Access to the arrayrefs for the specific child types.$code_or_ar = $unit->primaryβ Get the primary, which may be an arrayref of other units, or a single coderef.
π¦ SOURCE π¦
The source code repository for Test::Stream can be found at http://github.com/Test-More/Test-Stream/.
π MAINTAINERS π
Chad Granum <exodist@cpan.org>
π AUTHORS π
Chad Granum <exodist@cpan.org>
π COPYRIGHT π
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 bestie, you ate π β¨
this was perl v5.42.0, dated 2025-07-25, from the User Contributed Perl Documentation β stay hydrated, read your docs, and don't use experimental modules in prod without a vibe check π«Άπ
π¦ where this page comes from
- fedora 43: perl-Test-Stream 1.302027-35.fc43 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms