]> Repositorios git - scryer-prolog.git/commitdiff
Remove redundant unit test file
authorJ.J. Tolton <[email protected]>
Sun, 9 Nov 2025 17:56:02 +0000 (12:56 -0500)
committerJ.J. Tolton <[email protected]>
Sun, 9 Nov 2025 17:56:47 +0000 (12:56 -0500)
The custom_toplevel.pl unit tests were trivial and didn't actually test
the functionality. All real testing is done via comprehensive CLI tests
in tests/scryer/cli/src_tests/custom_toplevel.md

src/tests/custom_toplevel.pl [deleted file]
tests/scryer/cli/src_tests/custom_toplevel_tests.toml [deleted file]

diff --git a/src/tests/custom_toplevel.pl b/src/tests/custom_toplevel.pl
deleted file mode 100644 (file)
index 7e15fbc..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-:- module(custom_toplevel_tests, []).
-
-:- use_module(test_framework).
-
-% Helper predicates for CLI testing
-custom_halt :-
-    format("Custom toplevel executed~n", []),
-    halt(0).
-
-custom_halt_with_code :-
-    format("Custom toplevel with exit code~n", []),
-    halt(42).
-
-test_predicate :-
-    format("Test predicate executed~n", []).
-
-% Test predicates for g_caused_exception/2
-check_for_exception :-
-    (   '$toplevel':g_caused_exception(_Goal, Exception) ->
-        format("Exception occurred: ~w~n", [Exception]),
-        halt(1)
-    ;   format("No exception~n", []),
-        halt(0)
-    ).
-
-% Prolog integration tests
-test("custom toplevel functionality is tested via CLI tests", (
-    true
-)).
-
-test("g_caused_exception/2 is not asserted when no exception occurs", (
-    retractall('$toplevel':g_caused_exception(_, _)),
-    \+ '$toplevel':g_caused_exception(_, _)
-)).
-
-test("g_caused_exception/2 can be checked from custom toplevel", (
-    % This tests the predicate structure; actual exception handling
-    % is tested via CLI tests since it requires -g and -t flags
-    retractall('$toplevel':g_caused_exception(_, _)),
-    asserta('$toplevel':g_caused_exception(test_goal, test_error)),
-    '$toplevel':g_caused_exception(test_goal, test_error),
-    retractall('$toplevel':g_caused_exception(_, _))
-)).
diff --git a/tests/scryer/cli/src_tests/custom_toplevel_tests.toml b/tests/scryer/cli/src_tests/custom_toplevel_tests.toml
deleted file mode 100644 (file)
index 64c2122..0000000
+++ /dev/null
@@ -1 +0,0 @@
-args = ["-f", "--no-add-history", "src/tests/custom_toplevel.pl", "-f", "-g", "use_module(library(custom_toplevel_tests)), custom_toplevel_tests:main_quiet(custom_toplevel_tests)", "-t", "halt"]