Files
mercury/tests/hard_coded/string_index_next_ilseq.exp
Peter Wang d055627fd2 Define behaviour of string.index_next on ill-formed sequences.
library/string.m:
    Make string.index_next and string.unsafe_index_next
    return either U+FFFD or an unpaired surrogate code point
    when an ill-formed code unit sequence is detected.

tests/hard_coded/Mmakefile:
tests/hard_coded/string_index_next_ilseq.exp:
tests/hard_coded/string_index_next_ilseq.exp2:
tests/hard_coded/string_index_next_ilseq.m:
    Add test case.
2019-10-24 09:14:46 +11:00

6 lines
181 B
Plaintext

string.index_next(S, 0, 4, 0x1f600)
string.index_next(S, 4, 5, 0xfffd)
string.index_next(S, 5, 6, 0xfffd)
string.index_next(S, 6, 10, 0x1f600)
string.index_next(S, 10, _, _) failed