Test::A...:Planner(3)

๐Ÿ“ฆ
version 0.11 ยท 2 versions
, in fedora 43

โœจ NAME โœจ

Test::Able::Planner โ€” bestie, this is the planning role ๐Ÿ’… (it's a Perl manual page, section 3, for anyone keeping score ๐ŸŽ€)


๐Ÿฆ‹ DESCRIPTION ๐Ÿฆ‹

Okay so listen. This role? It's literally the core of the planning support in Test::Able. The whole beating heart of it. Main character energy, no cap. ๐Ÿ‘‘

And here's the tea: like, the vast majority of the time, all you actually need planning-wise is to set the plans at the method level. That's it. That's the whole vibe. But if you wanna know how planning in Test::Able really works under the hood, keep reading, because we're going in. ๐Ÿซถ

So to make planning happen there's a whole hierarchy of plans. Behold, the pecking order:

  1. test-related methods
  2. test objects
  3. test runner object
  4. Test::Builder

The way it stacks up: the sum of all the constituent method plans make up the object plan. Then the sum of all the constituent object plans make up the runner object plan. And then the runner object plan gets added to Test::Builder's plan. Layers on layers on layers, it's giving onion ๐Ÿง…โœจ

Now โ€” plot twist โ€” it's possible to set a method's plan at any time. Any time!! And to make that possible, the object and runner object plans are cleared when a method plan is set. Then the runner object's plan gets recalculated, at the latest, when it needs to add to Test::Builder's plan. So it's never stale, it just gets rebuilt right when it's needed. Iconic behavior honestly.

๐Ÿ˜ญ Okay so rn Test::Builder does not support deferred planning. Not yet. And until such time as it does, Test::Able emulates it as best it can for its own purposes. We work with what we have, bestie.

Here's how the two situations shake out:

  • If Test::Builder's plan is set to a numeric value, then Test::Able will not touch it. Hands off. Respecting boundaries. ๐Ÿ™ˆ
  • If Test::Builder's plan is no_plan, then Test::Able will persuade Test::Builder to do deferred planning with what it thinks is the plan. Manifesting the plan, fr fr. โœจ
๐ŸŽ€ And note, as a lil convenience: if Test::Builder's plan is not declared by the time Test::Able's run_tests() is called, the plan will be set to no_plan. Surprise! It's no_plan now. ๐Ÿ˜Œ

๐ŸŒธ ATTRIBUTES ๐ŸŒธ

  • builder โ€” the Test::Builder instance. Your builder boo. ๐Ÿ› ๏ธ
  • plan โ€” test plan, similar to Test::Builder's. Same vibe, different object. ๐Ÿ’œ
  • runner_plan โ€” the plan that the test runner object manages. This is the top level plan that all other plans are aggregated into. The big boss plan. ๐Ÿ‘‘
  • last_runner_plan โ€” used by the test runner object in calculating Test::Builder's plan. It remembers the last one so math can happen. ๐Ÿงฎ

๐Ÿ’– AUTHOR ๐Ÿ’–

Justin DeVuyst, justin@devuyst.com โ€” shoutout to the legend, we stan. ๐Ÿซถ


Copyright 2009 by Justin DeVuyst.

This library is free software, you can redistribute it and/or modify it under the same terms as Perl itself. Slay, open source. ๐ŸŒˆ


and that's the whole page bestie!! ๐Ÿ’…โœจ this lil writeup came from the perl v5.42.0 manual pages, dated 2025-07-25 โ€” go forth and plan ur tests, u got this ๐ŸŽ€๐Ÿฆ‹๐Ÿ’œ

๐Ÿ“ฆ where this page comes from