Files
mercury/tests/hard_coded/string_code_point.exp2
Zoltan Somogyi 80943c1142 Fix some Java/C# test case failures.
library/rtti_implementation.m:
    Return zero arity for null TypeInfo.args arrays. This fixes the
    failure of the hard_coded/pretty_printing test case in the Java grade,
    and probably in the C# grade as well.

tests/general/read_dir_regression.m:
    Fix the failure of the failure of this test case in the Java grade,
    by massaging the error message returned for an intentionally-failed
    open of a directory as a plain file. When opening ".", the error message
    (on my laptop, at least) returns the full absolute path name of the
    current directory. Since this will be different in different workspaces,
    we can't update the expected output file, but we can replace this
    changeable part of the error message with a fixed string. This diff
    does this.

tests/hard_coded/ho_solns.m:
    Add a note about the cause of the failure of this test case.

tests/hard_coded/string_code_point.exp2:
    Conform to the old switchover from the "codepoint" spelling
    to "code_point".
2025-09-04 23:44:40 +02:00

191 lines
5.8 KiB
Plaintext

count_code_units:
7
count_code_points:
6
code_point_offset:
string.code_point_offset(Str, 0, 0)
string.code_point_offset(Str, 0, 1, 1)
string.index(Str, 0, 'a')
string.code_point_offset(Str, 1, 1)
string.code_point_offset(Str, 1, 1, 2)
string.index(Str, 1, 'ß')
string.code_point_offset(Str, 2, 2)
string.code_point_offset(Str, 2, 1, 3)
string.index(Str, 2, 'ξ')
string.code_point_offset(Str, 3, 3)
string.code_point_offset(Str, 3, 1, 4)
string.index(Str, 3, '啕')
string.code_point_offset(Str, 4, 4)
string.code_point_offset(Str, 4, 1, 6)
string.index(Str, 4, '𐀀')
string.code_point_offset(Str, 5, 6)
string.code_point_offset(Str, 6, 1, _) failed
string.index(Str, 6, '.')
string.code_point_offset(Str, 6, _) failed
to_char_list:
['a', 'ß', 'ξ', '啕', '𐀀', '.']
from_char_list:
aßξ啕𐀀.
from_rev_char_list:
.𐀀啕ξßa
to_code_unit_list:
[97, 223, 958, 21845, 55296, 56320, 46]
from_code_unit_list:
aßξ啕𐀀.
index_next:
index_next(Str, 0, 1, 'a')
index_next(Str, 1, 2, 'ß')
index_next(Str, 2, 3, 'ξ')
index_next(Str, 3, 4, '啕')
index_next(Str, 4, 6, '𐀀')
index_next(Str, 6, 7, '.')
end
index_next(-1):
end
unsafe_index_next:
unsafe_index_next(Str, 0, 1, 'a')
unsafe_index_next(Str, 1, 2, 'ß')
unsafe_index_next(Str, 2, 3, 'ξ')
unsafe_index_next(Str, 3, 4, '啕')
unsafe_index_next(Str, 4, 6, '𐀀')
unsafe_index_next(Str, 6, 7, '.')
end
unsafe_prev_index:
unsafe_prev_index(Str, 7, 6, '.')
unsafe_prev_index(Str, 6, 4, '𐀀')
unsafe_prev_index(Str, 4, 3, '啕')
unsafe_prev_index(Str, 3, 2, 'ξ')
unsafe_prev_index(Str, 2, 1, 'ß')
unsafe_prev_index(Str, 1, 0, 'a')
end
split_by_code_point:
split_by_code_point(Str, -1, "", "aßξ啕𐀀.")
split_by_code_point(Str, 0, "", "aßξ啕𐀀.")
split_by_code_point(Str, 1, "a", "ßξ啕𐀀.")
split_by_code_point(Str, 2, "aß", "ξ啕𐀀.")
split_by_code_point(Str, 3, "aßξ", "啕𐀀.")
split_by_code_point(Str, 4, "aßξ啕", "𐀀.")
split_by_code_point(Str, 5, "aßξ啕𐀀", ".")
split_by_code_point(Str, 6, "aßξ啕𐀀.", "")
left_by_code_point:
aßξ
right_by_code_point:
啕𐀀.
between_code_points:
between_code_points(Str, -2, -2, "")
between_code_points(Str, -2, -1, "")
between_code_points(Str, -2, 0, "")
between_code_points(Str, -2, 1, "a")
between_code_points(Str, -2, 2, "aß")
between_code_points(Str, -2, 3, "aßξ")
between_code_points(Str, -2, 4, "aßξ啕")
between_code_points(Str, -2, 5, "aßξ啕𐀀")
between_code_points(Str, -2, 6, "aßξ啕𐀀.")
between_code_points(Str, -2, 7, "aßξ啕𐀀.")
between_code_points(Str, -1, -2, "")
between_code_points(Str, -1, -1, "")
between_code_points(Str, -1, 0, "")
between_code_points(Str, -1, 1, "a")
between_code_points(Str, -1, 2, "aß")
between_code_points(Str, -1, 3, "aßξ")
between_code_points(Str, -1, 4, "aßξ啕")
between_code_points(Str, -1, 5, "aßξ啕𐀀")
between_code_points(Str, -1, 6, "aßξ啕𐀀.")
between_code_points(Str, -1, 7, "aßξ啕𐀀.")
between_code_points(Str, 0, -2, "")
between_code_points(Str, 0, -1, "")
between_code_points(Str, 0, 0, "")
between_code_points(Str, 0, 1, "a")
between_code_points(Str, 0, 2, "aß")
between_code_points(Str, 0, 3, "aßξ")
between_code_points(Str, 0, 4, "aßξ啕")
between_code_points(Str, 0, 5, "aßξ啕𐀀")
between_code_points(Str, 0, 6, "aßξ啕𐀀.")
between_code_points(Str, 0, 7, "aßξ啕𐀀.")
between_code_points(Str, 1, -2, "")
between_code_points(Str, 1, -1, "")
between_code_points(Str, 1, 0, "")
between_code_points(Str, 1, 1, "")
between_code_points(Str, 1, 2, "ß")
between_code_points(Str, 1, 3, "ßξ")
between_code_points(Str, 1, 4, "ßξ啕")
between_code_points(Str, 1, 5, "ßξ啕𐀀")
between_code_points(Str, 1, 6, "ßξ啕𐀀.")
between_code_points(Str, 1, 7, "ßξ啕𐀀.")
between_code_points(Str, 2, -2, "")
between_code_points(Str, 2, -1, "")
between_code_points(Str, 2, 0, "")
between_code_points(Str, 2, 1, "")
between_code_points(Str, 2, 2, "")
between_code_points(Str, 2, 3, "ξ")
between_code_points(Str, 2, 4, "ξ啕")
between_code_points(Str, 2, 5, "ξ啕𐀀")
between_code_points(Str, 2, 6, "ξ啕𐀀.")
between_code_points(Str, 2, 7, "ξ啕𐀀.")
between_code_points(Str, 3, -2, "")
between_code_points(Str, 3, -1, "")
between_code_points(Str, 3, 0, "")
between_code_points(Str, 3, 1, "")
between_code_points(Str, 3, 2, "")
between_code_points(Str, 3, 3, "")
between_code_points(Str, 3, 4, "啕")
between_code_points(Str, 3, 5, "啕𐀀")
between_code_points(Str, 3, 6, "啕𐀀.")
between_code_points(Str, 3, 7, "啕𐀀.")
between_code_points(Str, 4, -2, "")
between_code_points(Str, 4, -1, "")
between_code_points(Str, 4, 0, "")
between_code_points(Str, 4, 1, "")
between_code_points(Str, 4, 2, "")
between_code_points(Str, 4, 3, "")
between_code_points(Str, 4, 4, "")
between_code_points(Str, 4, 5, "𐀀")
between_code_points(Str, 4, 6, "𐀀.")
between_code_points(Str, 4, 7, "𐀀.")
between_code_points(Str, 5, -2, "")
between_code_points(Str, 5, -1, "")
between_code_points(Str, 5, 0, "")
between_code_points(Str, 5, 1, "")
between_code_points(Str, 5, 2, "")
between_code_points(Str, 5, 3, "")
between_code_points(Str, 5, 4, "")
between_code_points(Str, 5, 5, "")
between_code_points(Str, 5, 6, ".")
between_code_points(Str, 5, 7, ".")
between_code_points(Str, 6, -2, "")
between_code_points(Str, 6, -1, "")
between_code_points(Str, 6, 0, "")
between_code_points(Str, 6, 1, "")
between_code_points(Str, 6, 2, "")
between_code_points(Str, 6, 3, "")
between_code_points(Str, 6, 4, "")
between_code_points(Str, 6, 5, "")
between_code_points(Str, 6, 6, "")
between_code_points(Str, 6, 7, "")
between_code_points(Str, 7, -2, "")
between_code_points(Str, 7, -1, "")
between_code_points(Str, 7, 0, "")
between_code_points(Str, 7, 1, "")
between_code_points(Str, 7, 2, "")
between_code_points(Str, 7, 3, "")
between_code_points(Str, 7, 4, "")
between_code_points(Str, 7, 5, "")
between_code_points(Str, 7, 6, "")
between_code_points(Str, 7, 7, "")