Commit Graph

10 Commits

Author SHA1 Message Date
Julien Fischer
1f6d83692a Update programming style in tests/hard_coded.
tests/hard_coded/*.m:
    Update programming style, unless doing so would change
    the meaning of the test, in particular:

    - use '.' as a module qualifier in place of '__'
    - use {write,print}_line where appropriate
    - use if-then-else in place of C -> T ; E
    - use state variables in place of DCGs

tests/hard_coded/dir_test.m:
    Document what the expected outputs correspond to.

    Use a uniform module qualifier in the output.

tests/hard_coded/dir_test.exp*:
    Conform to the above change.
2021-01-07 13:58:12 +11: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
7bef55acb5 Remove more deprecated syntax.
Estimated hours taken: 0.1
Branches: main

tests/hard_coded/qual_strung.m:
tests/hard_coded/qual_strang.m:
	Remove more deprecated syntax.
2005-09-12 13:00:15 +00:00
Julien Fischer
f1f204e88c Deprecate the predicate int.to_float/2 in favour of float.float/1.
Estimated hours taken: 0.5
Branches: main

Deprecate the predicate int.to_float/2 in favour of float.float/1.
(There has been a comment describing this as obsolete for some time).

NEWS:
	Mention this change.

library/float.m:
	Add an implementation of float.float/1 rather than
	just calling int.to_float/2.

library/int.m:
	Add a pragma obsolete declaration to int.to_float/2.
	The implementation will have to stay until the predicate
	is deleted because importing the float module into this
	one results in type ambiguities.

library/term.m:
profiler/generate_output.m:
profiler/output.m:
profiler/propagate.m:
tests/hard_coded/agg.m:
tests/hard_coded/qual_strang.m:
tests/hard_coded/qual_strung.m:
	Change calls to int.to_float/2 to calls to float.float/1.
2004-07-08 06:00:50 +00:00
Zoltan Somogyi
6554ef7daa Replace "is" with "=".
Estimated hours taken: 2
Branches: main

Replace "is" with "=".
Add field names where relevant.
Replace integers with counters where relevant.
2003-05-26 09:01:46 +00:00
Simon Taylor
34c6b77b3c Generate exceptions rather than program aborts for domain errors
Estimated hours taken: 6
Branches: main

Generate exceptions rather than program aborts for domain errors
and out of bounds array accesses.

Improve the handling of the arithmetic functions.

library/float.m:
library/int.m:
compiler/builtin_ops.m:
	Handle division by zero with an exception rather than a
	program abort.

	Add int__unchecked_quotient and float__unchecked_quotient,
	which don't check for division by zero.

	Remove reverse modes of the arithmetic functions in float.m.
	Richard O'Keefe pointed out a while ago that they don't work
	because of rounding errors.

	Remove the long obsolete `int__builtin_*' and
	`float__builtin_float_*' predicates.

library/math.m:
library/array.m:
	Generate exceptions rather than program aborts.
	The bounds and domain checks are now implemented in
	Mercury, so they do not need to be duplicated for each
	target language.

library/exception.m:
	Remove predicate throw_string/1, which was used to throw
	exceptions from array.m across the C interface, which would
	not work in LLDS grades.

NEWS:
	Document the changes.

tests/general/float_test.m:
tests/general/string_format_test.m:
tests/hard_coded/ho_solns.m:
tests/hard_coded/ho_univ_to_type.m:
tests/hard_coded/qual_strang.m:
tests/hard_coded/qual_strung.m:
	Rename occurrences of `builtin_*'.
2001-09-02 12:20:14 +00:00
Fergus Henderson
11b2d32381 Various fixes to the test cases so that they work with `__'
as a module qualifier.

tests/general/commit_bug.m:
tests/general/mode_info_bug.m:
tests/general/partition.m:
tests/hard_coded/string_alignment.m:
	Delete `nl' predicate (and replace calls with calls to `io__nl')
	to avoid ambiguities with `io__nl'.

tests/general/partition.m:
	Rename `write' as `write_s'
	to avoid ambiguities with `io__write'.

tests/warnings/singleton_test.m:
tests/warnings/singleton_test.exp:
tests/warnings/pragma_source_code.m:
tests/warnings/pragma_source_code.exp:
	s/append/my_append/g
	to avoid ambiguities with `list__append'.

tests/general/parse_list.m:
tests/general/semidet_map.m:
	s/meta__/meta_/g
	to avoid errors about defining `meta__blah' in a module
	other than `meta'.

tests/hard_coded/qual_strang.m:
tests/hard_coded/qual_strung.m:
	s/string__//g
	to avoid errors about defining `string__blah' in a module
	other than `string'.

tests/valid/middle_rec_bug.m:
	s/garbage_out__/garbage_out_/g
	to avoid errors about defining `garbage_out__blah' in a module
	other than `garbage_out'.

tests/hard_coded/qual_basic_test.m:
tests/hard_coded/qual_adv_test.m:
	Eliminate double quantifiers, e.g. delete the `io__' in
	`io:io__write_string'.
	Also test calling `write_string' without `io:' or `io__'.
1997-02-23 06:12:24 +00:00
Simon Taylor
24405ae05e Test module qualified function calls and higher-order pred constants.
Estimated hours taken: 0.2

tests/hardcoded/qual_basic_test.m
tests/hardcoded/qual_adv_test.m
tests/hardcoded/qual_strang.m
tests/hardcoded/qual_strung.m
        Test module qualified function calls and higher-order pred constants.
1996-10-02 06:09:50 +00:00
Fergus Henderson
7e85ac8e95 Import `bool'.
Estimated hours taken: 0.1

tests/hard_coded/qual_*.m:
	Import `bool'.
1996-02-07 06:08:06 +00:00
Dylan Shuttleworth
08c2f17f4e A directory for tests that will not run under NU-prolog.
tests/hard_coded/:
	A directory for tests  that will not run under NU-prolog.  The
	expected outcome (`*.exp') files are hand written, and compared
	with output from the modules.

qual_*_test.m:
	Tests to ensure module qualification of predicates works correctly.
	qual_adv_test.m also tests that module names are used correctly to
	distinguish between predicates with similar/same names.

qual_*_test.exp:
	Expected output of above tests.
1995-10-19 05:44:20 +00:00