Test::...:Legacy(3pm)

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

πŸ’– Test::Inline::Content::Legacy β€” the manual page, bestie edition πŸ’–

From the User Contributed Perl Documentation collection, it's Test::...:Legacy(3pm) (yes that truncated-looking name is literally the page name, don't @ me, it's the section-3pm formatting doing its thing) πŸ’…


✨ NAME ✨

Test::Inline::Content::Legacy β€” it's the Test::Inline 2 Content Handler for legacy functions. That's it, that's the whole job description 🫢


🌸 VERSION 🌸

Version 2.214 bestie, write it down ✨


πŸ¦‹ SYNOPSIS πŸ¦‹

Okay so picture this: you wanna do custom script content generation using Test::Inline 2.000+ with your own custom generator functions. Iconic. Here's the vibe:

my $header = "....";
my $function = sub {
      my $Object = shift;
      my $Script = shift;
      return $header . $Script->merged_content;
};

my $Inline = Test::Inline->new(
      ...
      file_content => $function,
      );

And now the glow-up 🧚 β€” migrating that exact same code over to Test::Inline 2.100+ ContentHandler objects:

my $header = "....";
my $function = sub {
      my $Object = shift;
      my $Script = shift;
      return $header . $Script->merged_content;
};

my $ContentHandler = Test::Inline::Content::Legacy->new( $function );

my $Inline = Test::Inline->new(
      ...
      ContentHandler => $ContentHandler,
      );

Same energy, new plumbing, no cap πŸ’œ


πŸ’œ DESCRIPTION πŸ’œ

So this class exists purely to be a migration path for anyone out there using the custom script generators in Test::Inline via the file_content param. It's basically a little bridge, holding your hand across the river 🫢

And honestly? The synopsis above pretty much says all you need to know. It really does. It ate and left no crumbs πŸ‘‘


πŸŽ€ METHODS πŸŽ€

new $CODE_ref

The new constructor for Test::Inline::Content::Legacy takes a single parameter: a CODE reference. Like, the exact same one you would have previously handed directly over to file_content. Same lil guy, different doorway πŸšͺ✨

Returns a brand-new Test::Inline::Content::Legacy object… or undef if you didn't pass it a CODE reference. No code ref, no object, that's the rule bestie 😭

coderef

The coderef accessor returns the CODE reference for the object. Handy. Slay πŸ’…

process $Inline $Script

The process method works with the legacy function by passing the Test::Inline and Test::Inline::Script arguments straight through to the legacy function, and returning its result as the return value. Pure pass-through, no funny business, the middle-man of your dreams 🌈


πŸ’€ 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 to bug-Test-Inline@rt.cpan.org. Found a bug? Tell the tracker, not me, I'm just the messenger πŸ¦‹


πŸ‘‘ AUTHOR πŸ‘‘

Adam Kennedy <adamk@cpan.org> β€” legend behaviour, honestly 🌟


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 freedom, bestie πŸ•ŠοΈ


That's the whole page!! Go forth and migrate your legacy content handlers, you absolute main character πŸ«ΆπŸ’–

Kisses, this was perl v5.32.0, dated 2021-01-31, and it's been your girl from the Test::...:Legacy(3pm) page signing off βœ¨πŸ’…πŸŽ€

πŸ“¦ where this page comes from