languages/abc/t/01-tests.t - test harness for Parrot abc
This file is the current implementation for the abc test harness. The tests are actually in simple text files, this harness given this list of tests sources, executes all the tests.
The test source is a plain text file divided in three columns. The columns are separated by three white spaces \s{3,} or at least one tab \t+. The three columns are:
\s{3,}
\t+
The exact expression that is passed to the abc compiler as source code. This input is pasted as a double quotes delimited string into PIR code. This means that you can use \n to indicate newlines.
The expected result for the compiled source. Note that you can (and probably should) use \n in the expected result to represent newlines.
\n
This should be a string describing the test that is being made.
Since this is supposed to be a temporary harness. We're expecting to be able to capture the result of the compilation to write this file in PIR. The skip and todo tests are defined in the test source file itself, so that later when the harness is changed we don't have to bother to convert the skip/todo tests list. So, you can simply set a test to be todo or skipped by adding the SKIP or TODO keywords in the begin of the test description. For example:
SKIP
TODO
1+2+3 6 SKIP no add operation yet 1-2-3 6 TODO no minus operation yet
NOTE: to add more source test files remember to update the @files array in this file.
@files
$ prove languages/abc/t/01-tests.t
Nuno 'smash' Carvalho <mestre.smash@gmail.com>
To install Parrot::PMC, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Parrot::PMC
CPAN shell
perl -MCPAN -e shell install Parrot::PMC
For more information on module installation, please visit the detailed CPAN module installation guide.