aboutsummaryrefslogtreecommitdiff
path: root/compat-tests.el
diff options
context:
space:
mode:
authorPhilip Kaludercic <philipk@posteo.net>2025-06-11 21:36:35 +0200
committerPhilip Kaludercic <philipk@posteo.net>2025-06-11 21:36:35 +0200
commita9efb4a6c98da984a93df4a5d41d8d3e73459178 (patch)
treeea734c11cbaa65c3707f342e19b962a424c52ede /compat-tests.el
parent7179960b7c82a7cca6bac60d79dd7fe09ae390a0 (diff)
compat-28: Fix 'named-let's TCO involving short-circuiting 'and'
Diffstat (limited to 'compat-tests.el')
-rw-r--r--compat-tests.el6
1 files changed, 6 insertions, 0 deletions
diff --git a/compat-tests.el b/compat-tests.el
index b36eef8..cff3ff2 100644
--- a/compat-tests.el
+++ b/compat-tests.el
@@ -2447,6 +2447,12 @@
(cond ((= x 0) 'ok)
((and t (lop (1- x))))))
'ok)
+ (should-equal (let ((n 0))
+ (named-let lop ((l '(1 2 3)))
+ (setq n (1+ n))
+ (and l (lop (cdr l))))
+ n)
+ 4)
(should-equal (let ((b t))
(named-let lop ((i 0))
(cond ((null i) nil) ((= i 10000) 'ok)