From c52ce631fbc2f8836e10ff41895892839b349da3 Mon Sep 17 00:00:00 2001 From: Andrew Arensburger Date: Wed, 6 Apr 2022 14:58:44 -0400 Subject: [PATCH 1/2] 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. --- testing/lisp/test-org-macs.el | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/testing/lisp/test-org-macs.el b/testing/lisp/test-org-macs.el index 6a7ccea3c..c32d891a2 100644 --- a/testing/lisp/test-org-macs.el +++ b/testing/lisp/test-org-macs.el @@ -102,7 +102,16 @@ (should-not (org-test-with-temp-text "xx abc 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 -- 2.25.1