From: J.J. Tolton Date: Sun, 9 Nov 2025 17:56:02 +0000 (-0500) Subject: Remove redundant unit test file X-Git-Url: https://git.sagredo.dev/?a=commitdiff_plain;h=5357ecf8e30a27f31ee18b1213713c2fa55d13b4;p=scryer-prolog.git Remove redundant unit test file 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 --- diff --git a/src/tests/custom_toplevel.pl b/src/tests/custom_toplevel.pl deleted file mode 100644 index 7e15fbc7..00000000 --- a/src/tests/custom_toplevel.pl +++ /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 index 64c2122f..00000000 --- a/tests/scryer/cli/src_tests/custom_toplevel_tests.toml +++ /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"]