Files
mercury/tests/hard_coded/string_index_ilseq.exp2
Peter Wang 47d0f70ea4 Define behaviour of string.index on ill-formed sequences.
library/string.m:
    Make string.index/3 and string.unsafe_index/3
    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_ilseq.exp:
tests/hard_coded/string_index_ilseq.exp2:
tests/hard_coded/string_index_ilseq.m:
    Add test case.
2019-10-24 09:14:46 +11:00

7 lines
166 B
Plaintext

string.index(S, 0, 0x1f600)
string.index(S, 1, 0xde00)
string.index(S, 2, 0xd83d)
string.index(S, 3, 0x1f600)
string.index(S, 4, 0xde00)
string.index(S, 5, _) failed