Tests
-----

The test choice is quite ad-hoc - they are intended to cover all
language features but some are more complex than others. Any programs
which expose language bugs should be added to the test suite
(preferably in some simplified form).

001: Hello world, some arithmetic
002: Foreach loops, some higher order functions
003: Data structures
004: Array initialisation
005: Mutually recursive data structures
006: Basic modules
007: Type inference error
008: Structure field access
009: Multidimensional arrays
010: Global variables
011: Builtin functions
012: Arithmetic precedences
013: Tail recursion
014: Pass by reference
015: Dictionaries
016: Guarded definitions
017: Typed if expressions
018: Default function arguments
019: Pass by reference, value swapping
020: Binary chunks
021: Implicit coercions
022: Sort, copying arrays.
023: Type synonyms.
024: More type synonyms, with complex/circular definitions.
025: Data type errors (add more!)
026: Boolean operators, shortcut evaluation
027: Syntactic sugar for array ranges
028: do...while loops
029: Uninitialised array elements
030: Simple logging
031: Partial application
032: Lambda lifting
033: Lazy lists
034: Lambda scoping and typechecking
035: Marshalling closures

How regression testing works
----------------------------

Each testnnn subdirectory includes at least two files:

* run, which is a script to run the test
* expected, which is the expected output of the test.

The script runtest.pl takes the name of the test to run (or "all") to
run all of them, and runs the "run" script in the test directory. If
the output matches the expected output, the test succeeds, otherwise
it fails.

runtest.pl has optional arguments:
* -s shows the actual output of a test script.
* -d shows the differences between the expected and actual output 
  of a test.
* -u updates the expected output to the current output. Check
  carefully before running this.

If any tests fail in a release, it should be considered a bug. Do not
make a release before ensuring that all tests succeed.

