Commit Graph

4 Commits

Author SHA1 Message Date
Zoltan Somogyi
2bd7c5ee3e Rename X's aux modules as X_helper_N in hard_coded.
tests/hard_coded/*.m:
    Rename modules as mentioned above.

    In a few cases, where the main module's name itself had a suffix,
    such as "_mod_a" or "_main", remove that suffix. This entails
    renaming the .exp file as well. (In some cases, this meant that
    the name of a helper module was "taken over" by the main module
    of the test case.)

    Update all references to the moved modules.

    General updates to programming style, such as

    - replacing DCG notation with state var notation
    - replacing (C->T;E) with (if C then T else E)
    - moving pred/func declarations to just before their code
    - replacing io.write/io.nl sequences with io.write_line
    - replacing io.print/io.nl sequences with io.print_line
    - fixing too-long lines
    - fixing grammar errors in comments

tests/hard_coded/Mmakefile:
tests/hard_coded/Mercury.options:
    Update all references to the moved modules.

    Enable the constant_prop_int test case. The fact that it wasn't enabled
    before is probably an accident. (When constant_prop_int.m was created,
    the test case was added to a list in the Mmakefile, but that list
    was later removed due to never being referenced.)

tests/hard_coded/constant_prop_int.{m,exp}:
    Delete the calls to shift operations with negative shift amounts,
    since we have added a compile-time error for these since the test
    was originally created.
2023-06-16 08:33:22 +02:00
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
Julien Fischer
baf2ee19e9 Change the argument order of predicates in the rbtree and tree234 modules
Branches: main

Change the argument order of predicates in the rbtree and tree234 modules
to make them more conducive to the use of state variable notation.
(This change will break existing code that uses these modules but such
modules should be quite rare; most existing code uses the map module.)

library/rbtree.m:
	Change argument orderings as above.

	Add further modes for the foldl predicates that have
	(mostly-)unique accumulators.

library/tree234.m:
	Change argument orderings as above.

library/map.m:
profiler/generate_output.m:
tests/debugger/declarative/mapinit.m:
tests/hard_coded/transform_value.m:
	Conform to the above changes.

NEWS:
	Announce the above changes.
2011-05-18 15:40:35 +00:00
Ian MacLarty
6fba720b49 Add the operation transform_value to map, tree234 and rbtree.
Estimated hours taken: 2
Branches: main

Add the operation transform_value to map, tree234 and rbtree.  This applies a
higher order argument to a value in the map.  Often a value needs to be updated
using its previous value.  Currently this requires two lookups of the key.
With transform_value only one lookup is required.

NEWS
	Mention the new predicate.

library/map.m
library/rbtree.m
library/tree234.m
	Add transform_value.

library/require.m
	Add a version of report_lookup_error that doesn't take a value
	argument, since the value argument is not available in transform_value.

tests/hard_coded/Mmakefile
tests/hard_coded/transform_value.exp
tests/hard_coded/transform_value.m
	Test transform_value.
2005-01-13 11:04:38 +00:00