Commit Graph

3 Commits

Author SHA1 Message Date
Zoltan Somogyi
33eb3028f5 Clean up the tests in half the test directories.
tests/accumulator/*.m:
tests/analysis_*/*.m:
tests/benchmarks*/*.m:
tests/debugger*/*.{m,exp,inp}:
tests/declarative_debugger*/*.{m,exp,inp}:
tests/dppd*/*.m:
tests/exceptions*/*.m:
tests/general*/*.m:
tests/grade_subdirs*/*.m:
tests/hard_coded*/*.m:
    Make these tests use four-space indentation, and ensure that
    each module is imported on its own line. (I intend to use the latter
    to figure out which subdirectories' tests can be executed in parallel.)

    These changes usually move code to different lines. For the debugger tests,
    specify the new line numbers in .inp files and expect them in .exp files.
2015-02-14 20:14:03 +11:00
Peter Wang
36469c5975 Make cord foldl tail-recursive.
Make cord.foldl and cord.foldl_pred tail-recursive.  This may be
expected by users as cords are often used as a replacement for lists.

Also make the recursive calls in cord.foldr and cord.foldr_pred amenable
to last call optimisation.  However, they still use stack space
proportional to the size of the input due to calling list.foldr.

library/cord.m:
	As above.

tests/hard_coded/test_cord2.m:
tests/hard_coded/test_cord2.exp:
	Add tests for fold order.

NEWS:
	Announce the change.
2014-01-15 14:50:32 +11:00
Peter Wang
d74046340d Add test case for cords.
Test the recently changed functions more comprehensively:
cord.list, cord.rev_list, cord.cord_list_to_cord, cord.cord_list_to_list.

The existing test_cord.m is deficient, and did not reveal a bug in the
previous implementation of cord.rev_list (the non-tail-recursive one).

tests/hard_coded/Mmakefile:
tests/hard_coded/test_cord2.exp:
tests/hard_coded/test_cord2.m:
        Add test case.
2013-06-13 14:10:34 +10:00