add failing test highlighting panic on invalid UTF-8 cstr
Signed-off-by: Thierry Marianne <thierry@marianne.io>
This commit is contained in:
16
tests-pl/ffi_utf8_panic.pl
Normal file
16
tests-pl/ffi_utf8_panic.pl
Normal file
@@ -0,0 +1,16 @@
|
||||
:- use_module(library(os)).
|
||||
:- use_module(library(ffi)).
|
||||
|
||||
init :-
|
||||
read(Body),
|
||||
term_variables(Body, [LIB]),
|
||||
Body,
|
||||
use_foreign_module(LIB, [
|
||||
'ffi_invalid_utf8_cstr'([], cstr)
|
||||
]).
|
||||
|
||||
test :-
|
||||
ffi:'ffi_invalid_utf8_cstr'(Str),
|
||||
write(Str), nl.
|
||||
|
||||
:- initialization((init,test)).
|
||||
Reference in New Issue
Block a user