Files
mercury/tests/invalid/null_char.m
Zoltan Somogyi dea11e5931 Restore most of the invalid/null_char test case.
Delete the raw NULs, so we can get to and report the errors involving
non-raw NUL bytes generated by escape sequences.
2019-07-30 13:58:43 +02:00

48 lines
746 B
Mathematica

%---------------------------------------------------------------------------%
% vim: ts=4 sw=4 et ft=mercury
%---------------------------------------------------------------------------%
%
% Test handling of null characters (any null character is an error).
:- module null_char.
:- interface.
:- type foo == int.
:- implementation.
:- import_module char.
:- pred 'wr\0\ng1'(int).
'wr\0\ng'(1).
:- pred wrong2(string).
wrong2("wr\0\ng").
:- pred wrong3(string).
wrong3(_String) :-'wr\0\ng'.
:- pred wrong4(char).
wrong4('\0\').
:- pred 'wr\0\ng5'.
'wr\0\ng5'.
% wrong6 used to have a raw NUL byte.
:- pred wrong7(string).
wrong7("wr\x0\ng").
:- pred wrong8(string).
wrong8("wr\u0000ng").
% wrong9 used to have a raw NUL byte.