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
abb1e7d578 Fix an off-by-one bug in string.split_at_separator.
Estimated hours taken: 1
Branches: main

library/string.m:
	Fix an off-by-one bug in string.split_at_separator.  The index in the
	initial call to split_at_separator2 was one past the end of the
	string, which worked in the C backends because strings are NUL
	terminated.

	Rename split_at_separator2 to split_at_separator_2 and make it more
	readable.

tests/hard_coded/string_split.exp:
tests/hard_coded/string_split.m:
	Add a couple of cases which seem more likely to fail with an incorrect
	implementation.
2007-06-06 02:09:45 +00:00
Ondrej Bojar
1ab474865c A few handy functions for splitting a string added.
Estimated hours taken: 3
Branches: main

A few handy functions for splitting a string added.

library/string.m:
    Added remove_suffix_if_present, split_at_separator, split_at_char,
    split_at_string

tests/hard_coded/string_split.m:
    A simple test of split_at_* functions.

tests/hard_coded/string_split.exp:
    Expected results of the tests of split_at_* functions.

tests/hard_coded/string_various.m:
    Created. Added testcase for remove_suffix_if_present.

tests/hard_coded/string_various.exp:
    Created. Added results for remove_suffix_if_present.

NEWS:
    Added a comment that the functions have been added.
2007-02-02 05:39:58 +00:00