t/compilers/pge/perl6regex/01-regex.t -- Basic Perl6Regex tests
These tests are based on http://dev.perl.org/perl6/doc/design/syn/S05.html. Individual tests are stored in the rx_* files in the same directory; There is one test per line: each test consists of the following columns (separated by one *or more* tabs):
rx_*
The Perl 6 regex to test.
The string that will be matched against the pattern. Use '' to indicate an empty string.
The expected result of the match. Either y for a successful match, n for a failed one. Otherwise the output is expected to begin and end with /.
y
n
/
This result is used in one of two ways: If an exception is thrown by the match, the result must be contained in the exception's message. If the match succeeds, then the message must be contained in a dump of the match object.
A unique test identifier. This allows us to track TODO/SKIP information in *this* file instead of the associated test file, which lets us easily share the tests across implementations of perl6's regex engine.
Description of the test.
% prove t/compilers/pge/01-regex.t
Note that while our job would be easier if we could use regular expressions in here, but we want to avoid any dependency on the thing we're testing.
Need to add in test ids, to avoid the precarious line numbering.
To install Rakudo::Star, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Rakudo::Star
CPAN shell
perl -MCPAN -e shell install Rakudo::Star
For more information on module installation, please visit the detailed CPAN module installation guide.