Update tests to use format/2 instead of write/1

This commit is contained in:
J.J. Tolton
2025-11-09 12:05:23 -05:00
parent b91ce76052
commit 95abc4017e
2 changed files with 18 additions and 18 deletions

View File

@@ -4,24 +4,24 @@
% Helper predicates for CLI testing
custom_halt :-
write('Custom toplevel executed'), nl,
format("Custom toplevel executed~n", []),
halt(0).
custom_halt_with_code :-
write('Custom toplevel with exit code'), nl,
format("Custom toplevel with exit code~n", []),
halt(42).
test_predicate :-
write('Test predicate executed'), nl.
format("Test predicate executed~n", []).
% Test predicates for g_caused_exception/2
:- dynamic(g_caused_exception/2).
check_for_exception :-
( g_caused_exception(_Goal, Exception) ->
write('Exception occurred: '), write(Exception), nl,
format("Exception occurred: ~w~n", [Exception]),
halt(1)
; write('No exception'), nl,
; format("No exception~n", []),
halt(0)
).