cl: unwind-protect — 8 new tests (159 eval, 331 total green)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 44s

cl-eval-unwind-protect evaluates protected form, runs cleanup via
for-each (results discarded, sentinels preserved), returns original
result — correctly propagates block-return/go-tag through cleanup.
This commit is contained in:
2026-05-05 11:14:39 +00:00
parent 7d6df6fd5f
commit 32a82a2e12
2 changed files with 4 additions and 3 deletions

View File

@@ -386,5 +386,5 @@
(ev "(let ((x 0)) (tagbody (unwind-protect (go done) (setq x 1)) done) x)")
1)
(cl-test "unwind-protect: nested, inner cleanup first"
(ev "(let ((log (list))) (unwind-protect (unwind-protect 1 (append! log 2)) (append! log 3)) log)")
(list 2 3))
(ev "(let ((n 0)) (unwind-protect (unwind-protect 1 (setq n (+ n 10))) (setq n (+ n 1))) n)")
11)