mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-16 09:53:36 +00:00
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.
6 lines
181 B
Plaintext
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
|