Test::...Script(3pm)
β¨ Test::...Script β¨
okay bestie, so this is Test::...Script from the Test::Inline fam (it's a Perl module, it lives in section 3pm of your man pages, iykyk) π
πΈ VERSION πΈ
version 2.214 β that's the one, no cap β¨
π¦ DESCRIPTION π¦
so like. this class is where the heavy lifting happens. the actual generating of a test file? yeah, that's all happening right here, bestie π
give it a source filename and it will:
- load it
- parse out the relevant bits
- put them into order based on the tags
- merge them into a test file
and that's it. that's the whole vibe. iconic honestly π
π METHODS π
new
my $File = Test::Inline::Script->new( $class, \@sections, $check_count );
the new constructor takes a class name, a set of Section objects, and an optional check_count flag. that's the trio π«Ά
returns a Test::Inline::Script object when it goes well β¨ returns undef when it does not π
class
returns the class that the test file will test. simple as that, main character energy π
filename
my $filename = $File->filename;
the filename method hands you back the name of the output file that the tests should be written to. for example, the class Foo::Bar would have the filename value foo_bar.t π
config
my $config = $File->config;
the config method returns the config object for the file, assuming it has one. if more than one are found, the first will be used, and any additional config sections get discarded π (sorry to the extras)
returns a Test::Inline::Config object on success, or false if the file does not contain a config section.
setup
my @setup = $File->setup;
the setup method returns the setup sections from the file, in the same order as in the file. keeping it chronological, periodt β¨
returns a list of setup Test::Inline::Section objects, the null array () if the file does not contain any setup objects.
sections
my @sections = $File->sections;
the sections method returns all normal sections from the file, in the same order as in the file. heads up tho β this may not be the order they will be written to the test file, for that you should see the sorted method π
returns a list of Test::Inline::Section objects, or the null array () if the file does not contain any non-setup sections.
sorted
the sorted method returns all normal sections from the file, in an order that satisfies any dependencies in the sections. it's giving organized π§
returns a reference to an array of Test::Inline::Section objects, 0 if the file does not contain any non-setup sections, or undef on error.
tests
if the number of tests for all of the sections within the file are known, then the number of tests for the entire file can also be determined. math is mathing π₯
the tests method determines if the number of tests can be known, and if so, calculates and returns the number of tests. returns false if the number of tests is not known.
merged_content
the merged_content method generates and returns the merged contents of all the sections in the file, including the setup sections at the beginning π the method does not return the entire file, merely the part contained in the sections. for the full file contents, see the file_content method.
returns a string containing the merged section content on success, false if there is no content, despite the existence of sections ( which would have been empty ), or undef on error.
π 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 bug-Test-Inline@rt.cpan.org <mailto:bug-Test-Inline@rt.cpan.org>).
bestie if you find a bug, please do report it, don't just scream into the void π
π AUTHOR π
Adam Kennedy <adamk@cpan.org>
π COPYRIGHT AND LICENSE π
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. slay π
that's the whole page, babe π«Ά this was perl v5.32.0, dated 2021-01-31, and it's Test::...Script(3pm) β go forth and generate those test files β¨ππΈ
π¦ where this page comes from
- debian bookworm: libtest-inline-perl 2.214-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libtest-inline-perl 2.214-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu jammy: libtest-inline-perl 2.214-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libtest-inline-perl 2.214-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libtest-inline-perl 2.214-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libtest-inline-perl 2.214-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms