Files
mercury/tests/hard_coded/char_to_string.exp2
Peter Wang 658c8a5ad5 Define behaviour of string.char_to_string on edge cases.
library/string.m:
    Define behaviour of char_to_string when the string is not
    well-formed or if the char is a surrogate code point.

    Implement char_to_string/2 using multiple clauses
    as the described behaviour doesn't match to_char_list/2.

tests/hard_coded/Mmakefile:
tests/hard_coded/char_to_string.exp:
tests/hard_coded/char_to_string.exp2:
tests/hard_coded/char_to_string.m:
    Add test case.
2019-10-30 11:21:02 +11:00

12 lines
252 B
Plaintext

exception: software_error("predicate `string.from_char_list\'/2: Unexpected: null character or surrogate code point in list")
succeeded: 0xd83d
succeeded: 0xde00
succeeded: 😀
failed
failed
failed
succeeded: 0xd83d
succeeded: 0xde00
succeeded: 😀