Test::...Extract(3pm)

πŸ“¦
version 2.214 Β· 3 versions
, in debian bookworm, debian trixie, ubuntu jammy, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– Test::Inline::Extract β€” the manual, but make it cute

okay bestie, so this is the page for Test::Inline::Extract(3pm) β€” it lives in the User Contributed Perl Documentation and honestly? it's giving "small module, big job". Let's get into it. πŸ¦‹


✨ NAME ✨

Test::Inline::Extract β€” it pulls the relevant Pod sections out of your source code. That's the whole vibe. πŸŽ€

🌸 VERSION 🌸

version 2.214 β€” yes, that's the number, no cap.

πŸ’… DESCRIPTION πŸ’…

So the Test::Inline::Extract package goes through source files and extracts the content that's interesting to Test::Inline. That's it. That's the job. It's a little content-picker-upper and it slays at it. ✨

🫢 METHODS 🫢

🧚 new $file | \$source

The new constructor makes you a shiny new Extract object. You hand it either:

  • a file name, and the source code gets loaded from there, or
  • a reference to a string that directly contains the source code.

It returns a new Test::Inline::Extract object β€” or undef if something went wrong. 😭 (yes, undef on error, that's the deal.)

πŸ‘‘ elements

my $elements = $Extract->elements;

The elements method reaches into the Pod and extracts any parts of the file that matter to the extraction and generation process of Test::Inline.

These elements are gonna be either package statements, or a section of inline unit tests. And here's the lil rule: they only come back to you if there's at least one section of inline unit tests. No tests, no elements, periodt. πŸ’€

Returns a reference to an array of package strings and sections of inline unit tests. Returns false if there are no sections containing inline unit tests. Not undef, not an empty arrayref β€” false. iykyk.

🌈 TO DO 🌈

  • For certain very complex cases, add a more intensive alternative parser based on PPI.

(so that's a future-vibe thing, not a current-vibe thing, don't come for me)

πŸ’œ SUPPORT πŸ’œ

See the main SUPPORT section. πŸ‘€

Bugs may be submitted through the RT bug tracker <https://rt.cpan.org/Public/Dist/Display.html?Name=Test-Inline> β€” or, if you're feeling email-y, to bug-Test-Inline@rt.cpan.org <mailto:bug-Test-Inline@rt.cpan.org>.

⭐ AUTHOR ⭐

Adam Kennedy <adamk@cpan.org> β€” the icon, the legend, the one who wrote this.

This software is copyright (c) 2003 by Adam Kennedy.

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


that's the whole page, every flag, every fact, every undef, all of it. nothing skipped, nothing invented. πŸ’–

this was perl v5.32.0, dated 2021-01-31, from the Test::...Extract(3pm) page β€” mwah, go forth and extract responsibly βœ¨πŸ’…πŸŒΈ

πŸ“¦ where this page comes from