aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorSpencer Baugh2025-08-28 15:04:39 -0400
committerEli Zaretskii2025-08-30 13:59:18 +0300
commitb610f36d44dda3beb5cf2b8b65bfb0d005afed5c (patch)
treec4246d570f0c3e7210801d677a42b4008d27d415 /test
parent7efaa4657a10a0ec911a8fc8228260f30f1d7b55 (diff)
downloademacs-b610f36d44dda3beb5cf2b8b65bfb0d005afed5c.tar.gz
emacs-b610f36d44dda3beb5cf2b8b65bfb0d005afed5c.zip
Document and test 'let-alist' support for indexing
* etc/NEWS: Announce 'let-alist' support for indexing. * test/lisp/emacs-lisp/let-alist-tests.el (let-alist-numbers): Add a test for 'let-alist's support for indexing. * doc/lispref/lists.texi (Association Lists): Document indexing with 'let-alist'. (Bug#66509)
Diffstat (limited to 'test')
-rw-r--r--test/lisp/emacs-lisp/let-alist-tests.el11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/lisp/emacs-lisp/let-alist-tests.el b/test/lisp/emacs-lisp/let-alist-tests.el
index 988b05b488c..b23178f5467 100644
--- a/test/lisp/emacs-lisp/let-alist-tests.el
+++ b/test/lisp/emacs-lisp/let-alist-tests.el
@@ -100,4 +100,15 @@ See Bug#24641."
100 `[,(+ .a) ,(+ .a .b .b)]) 100 `[,(+ .a) ,(+ .a .b .b)])
101 [1 5]))) 101 [1 5])))
102 102
103(ert-deftest let-alist-numbers ()
104 "Check that .num indexes into lists."
105 (should (equal
106 (let-alist
107 '(((a . val1) (b . (nil val2)))
108 (c . (val3)))
109 (list .0 .0.a .0.b.1 .c.0))
110 ;; .0 is interpreted as a number, so we can't use `let-alist'
111 ;; to do indexing alone. Everything else works though.
112 '(0.0 val1 val2 val3))))
113
103;;; let-alist-tests.el ends here 114;;; let-alist-tests.el ends here