in reply to Re: Parameter injection for testing
in thread [Solved] Parameter injection for testing

The point (for me) of using a modulino is that the code can be invoked from the command line, but it can be used by a test script and unit tests run. Have a look at Szabgab's post https://perlmaven.com/modulino-both-script-and-module. I have struggled with unit tests for command line scripts in the past & have found modulinos a very elegant solution.

Regards,

John Davies

Replies are listed 'Best First'.
Re^3: Parameter injection for testing
by LanX (Saint) on Aug 25, 2022 at 21:05 UTC
    I'm using modulinos differently (at least I think so)

    If the module is called directly prove is executed.

    Like this I can hit F5 (run) in editor buffers holding the module for the whole suite or on individual test files for them only.

    Like with Perl::Tidy and perltidy.pl, I rather prefer one (or more) separate script.pl instead of adding that functionality into the module.

    And the scripts are also executed with the same F5 key.

    Some prefer an extra key/command to run the test suite but this requires individual configuration of the IDE or the "project file".

    I rather prefer holding the current prove config as perl code in the modules while developing.

    Cheers Rolf
    (addicted to the Perl Programming Language :)
    Wikisyntax for the Monastery