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.
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.
Estimated hours taken: 0.5
Branches: main
Allow strings of digits prefixed by a single '+' to be converted
to arbitrary precision integers.
library/integer.m:
Modify integer.from_string/1 and integer.det_from_string/1
so that they accept strings that match the regexp [+-]?[0-9]+.
Previously they would fail to correctly convert a string of
digits if it was prefixed by a single '+'.
This now corresponds to the behaviour of string.to_int/1
and string.det_to_int/1.
tests/hard_coded/integer_test.m:
Check that strings of digits prefixed with '+' are converted
correctly.
Estimated hours taken: 1
Branches: main
Add a new function to the integer module and deprecate an
existing predicate.
library/integer.m:
Add a function integer.det_from_string/1 that is similar
to integer.from_string/1 except that it throws an
exception instead of failing if the string cannot be
converted to an integer.
Deprecate the predicate version of integer.pow. We don't
gain anything from having both a predicate and function
version.
library/string.m:
Replace a call to the predicate version of integer.pow with
a call to the function version.
tests/hard_coded/integer_test.m:
Test integer.det_from_string.
Replace instances of `:' as the module qualifier.
Include integer.one/0 and integer.zero/0 in some
of the tests.
NEWS:
Mention these changes.
Estimated hours taken: 0.1
Moved tests of library/{integer,rational}.m from tests/general to
tests/hard_coded since the library modules and their tests cannot
be compiled under NU-Prolog.
general/Mmakefile:
general/.cvsignore:
Removed references to integer_test and rational_test.
general/integer_test.m:
general/integer_test.exp:
general/rational_test.exp:
general/rational_test.m:
File removed.
hard_coded/Mmakefile:
hard_coded/.cvsignore:
Added references to integer_test and rational_test.
hard_coded/integer_test.m:
hard_coded/integer_test.exp:
hard_coded/rational_test.exp:
hard_coded/rational_test.m:
File added.