]> Repositorios git - scryer-prolog.git/commit
Add comprehensive tests for g_caused_exception/2
authorJ.J. Tolton <[email protected]>
Sat, 8 Nov 2025 17:59:00 +0000 (12:59 -0500)
committerJ.J. Tolton <[email protected]>
Sun, 9 Nov 2025 17:44:48 +0000 (12:44 -0500)
commitb91ce7605252b36ccb691eb8fe6eb1de2b4b6ef1
tree0237bf258d1f8423bf39445d4227494af19e1ae0
parent617a551a56b3cc1f90c4c52ec2f215cf6b066cb6
Add comprehensive tests for g_caused_exception/2

Following TESTING_GUIDE.md, added tests at layers 2 and 3:

Layer 2 - Prolog Integration Tests (src/tests/custom_toplevel.pl):
- Test that g_caused_exception/2 is not asserted when no exception occurs
- Test that g_caused_exception/2 can be checked from custom toplevel
- Added check_for_exception/0 helper predicate for testing

Layer 3 - CLI Tests (tests/scryer/cli/src_tests/custom_toplevel.md):
- Test g_caused_exception/2 with exception thrown
- Test g_caused_exception/2 with no exception
- Test g_caused_exception/2 with error/2 terms
- Added test helper predicates in fixtures/toplevel_test_helper.pl

All tests pass successfully.

Co-Authored-By: J.J.'s Robot <[email protected]>
src/tests/custom_toplevel.pl
tests/scryer/cli/fixtures/toplevel_test_helper.pl [new file with mode: 0644]
tests/scryer/cli/src_tests/custom_toplevel.md [new file with mode: 0644]