mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-16 01:43:35 +00:00
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.
6 lines
180 B
Plaintext
6 lines
180 B
Plaintext
string.prev_index(S, 10, 6, 0x1f600)
|
|
string.prev_index(S, 6, 5, 0xfffd)
|
|
string.prev_index(S, 5, 4, 0xfffd)
|
|
string.prev_index(S, 4, 0, 0x1f600)
|
|
string.prev_index(S, 0, _, _) failed
|