Files
mercury/tests/hard_coded/string_first_char_ilseq.exp
Peter Wang 56687d235e Define behaviour of string.first_char/3 on edge cases.
library/string.m:
    Define first_char/3 to fail if the input string begins with an
    ill-formed code unit sequence.

    Define the reverse mode to throw an exception on an attempt to
    encode a null character or surrogate code point in the output
    string.

    Reimplement first_char/3 in Mercury.

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

11 lines
514 B
Plaintext

first_char(in, out, in) failed
first_char(in, out, out) failed
first_char(in, in, in) failed
first_char(in, in, out) failed
first_char(in, in, in) failed
first_char(in, in, out) failed
first_char(in, in, in) failed
first_char(in, in, out) failed
first_char(out, in, in) threw exception: software_error("predicate `string.first_char_str_out\'/3: Unexpected: surrogate code point")
first_char(out, in, in) threw exception: software_error("predicate `string.first_char_str_out\'/3: Unexpected: surrogate code point")