Script

NAME

Test::Script - Test-run a script

SYNOPSIS

use Test::Script;
output-is "script.p6", "hello: goodbye\n", "Two args ",
            args => ["--msg=goodbye", "hello"];
output-like "script.p6, /"hello ā†’ goodbye"/, "Prints environment ",
            env => { "hello" => "goodbye" };
variable-ok "script.p6", '$foo', "Variable exists and is set";
    variable-is "script.p6", '$foo', <bar baz>, "Variable exists and has value";

DESCRIPTION

This module is intended as a white-box test for scripts. Instead of running them as black boxes, it incorporates them into the current program, allowing better examination of its internal workings.

For the time being, it's just the output, but in the roadmap is the examination of variable values and other dynamic stuff.

CAVEATS

You can't test the same script twice in the same file. As a workaround (probably temporary), call it under different names such as ./script.p6 or ../dir/script.p6; alternatively, just use different tests for different scripts.

AUTHOR

JJ Merelo <[email protected]>

COPYRIGHT AND LICENSE

Copyright 2020,2022 JJ Merelo

This library is free software; you can redistribute it and/or modify it under the Artistic 2.0 license

Test::Script v0.0.4

A set of white-box tests for scripts

Authors

  • JJ Merelo

License

Artistic-2.0

Dependencies

Test Dependencies

Provides

  • Test::Script

Documentation

The Camelia image is copyright 2009 by Larry Wall. "Raku" is trademark of the Yet Another Society. All rights reserved.