Browse Source

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
Andrew Arensburger 2 years ago
parent
commit
4a30e8cc0c
1 changed files with 9 additions and 0 deletions
  1. 9 0
      testing/lisp/test-org-macs.el

+ 9 - 0
testing/lisp/test-org-macs.el

@@ -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