test-org-macs.el: Add test for template-expansion bug

* testing/lisp/test-org-macs.el (ert-deftest test-org/fill-template):
There is a bug in `org-fill-template': it sorts and processes keys in
order of increasing length, so that "noweb" is seen before
"noweb-ref", and "tangle" before "tangle-mode".  So in a template that
includes "%noweb-ref", it will substitute the value of "noweb".

This change includes a test for this bug.

TINYCHANGE
This commit is contained in:
Andrew Arensburger 2022-04-06 14:58:44 -04:00 committed by Ihor Radchenko
parent 5f184b5f23
commit 4a30e8cc0c
No known key found for this signature in database
GPG Key ID: 6470762A7DA11D8B
1 changed files with 9 additions and 0 deletions

View File

@ -106,7 +106,16 @@
(should-not
(org-test-with-temp-text "xx abc<point> xx"
(org-in-regexp "abc" nil t))))
;;; Template
(ert-deftest test-org/fill-template ()
"Test `org-fill-template'"
(should
(string= "working"
(org-fill-template "%var-long"
'(("var" . "broken")
("var-long" . "working"))))))
;;; Time