Move g_caused_exception/2 dynamic directive to toplevel.pl

- Add dynamic directive in toplevel.pl with other module-level directives
- Update test files to reference it as '':g_caused_exception/2
- Remove redundant dynamic directives from test files
- All tests passing
This commit is contained in:
J.J. Tolton
2025-11-09 12:16:02 -05:00
parent 95abc4017e
commit e7c288f8f0
3 changed files with 11 additions and 14 deletions

View File

@@ -29,10 +29,8 @@ helper_predicate :-
format("Helper predicate works~n", []).
% g_caused_exception/2 testing predicates
:- dynamic(g_caused_exception/2).
check_exception_halt_1 :-
( g_caused_exception(Goal, Exception) ->
( '$toplevel':g_caused_exception(Goal, Exception) ->
format("EXCEPTION_CAUGHT~n", []),
format("Goal: ~w~n", [Goal]),
format("Exception: ~w~n", [Exception]),
@@ -42,7 +40,7 @@ check_exception_halt_1 :-
).
check_exception_halt_0 :-
( g_caused_exception(_, _) ->
( '$toplevel':g_caused_exception(_, _) ->
format("UNEXPECTED_EXCEPTION~n", []),
halt(1)
; format("SUCCESS_NO_EXCEPTION~n", []),