Parrot::Test::PGE - test functions for Perl 6 Grammar Engine
In a .t file:
use Parrot::Test tests => 2; use Parrot::Test::PGE; p6rule_is('abc', '^abc', 'BOS abc'); p6rule_isnt('abc', '^bc', 'BOS bc'); p6rule_like('abcdef', 'bcd', qr/0: <bcd @ 1>/, '$0 capture');
Parrot::Test::PGE provides functions for testing the grammar engine and Perl 6 rules.
p6rule_is($target, $pattern, $description)
Runs the target string against the Perl 6 pattern, passing the test if they match. Note that the pattern should be specified as a string and without leading/trailing pattern delimiters. (Hint: if you try using qr// for the $pattern then you're misreading what this does.)
p6rule_isnt($target, $pattern, $description)
Runs the target string against the Perl 6 pattern, passing the test if they do not match.
p6rule_like($target, $pattern, $expected, $description)
Runs the target string against the Perl 6 pattern, passing the test if the output produced by the test code matches the $expected parameter. Note that $expected is a Perl 5 pattern.
$expected
Patrick R. Michaud, pmichaud@pobox.com 18-Nov-2004
To install Ruby, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Ruby
CPAN shell
perl -MCPAN -e shell install Ruby
For more information on module installation, please visit the detailed CPAN module installation guide.