Files
mercury/tests/hard_coded/string_prev_index_ilseq.exp2
Peter Wang 0c9bdf2587 Define behaviour of string.prev_index on ill-formed sequences.
library/string.m:
    Make string.prev_index and string.unsafe_prev_index
    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_prev_index_ilseq.exp:
tests/hard_coded/string_prev_index_ilseq.exp2:
tests/hard_coded/string_prev_index_ilseq.m:
    Add test case.
2019-10-24 09:14:46 +11:00

6 lines
179 B
Plaintext

string.prev_index(S, 6, 4, 0x1f600)
string.prev_index(S, 4, 3, 0xd83d)
string.prev_index(S, 3, 2, 0xde00)
string.prev_index(S, 2, 0, 0x1f600)
string.prev_index(S, 0, _, _) failed