Skip to content

Commit

Permalink
Update tests and comments for new snippet syntax
Browse files Browse the repository at this point in the history
* contrib/lisp/org-export.el (org-export-snippet-translation-alist):
  Fix docstring.
(org-export-as): Fix code comment.
* testing/lisp/test-org-element.el: Update tests.
* testing/lisp/test-org-export.el: Update tests.
  • Loading branch information
Nicolas Goaziou committed Jun 30, 2012
1 parent 2e38ed3 commit ab82a9d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 11 deletions.
12 changes: 5 additions & 7 deletions contrib/lisp/org-export.el
Expand Up @@ -641,9 +641,9 @@ confirm the use of these lines."
This variable allows to provide shortcuts for export snippets.
For example, with a value of '\(\(\"h\" . \"html\"\)\), the HTML
back-end will recognize the contents of \"@h{<b>}\" as HTML code
while every other back-end will ignore it."
For example, with a value of '\(\(\"h\" . \"e-html\"\)\), the
HTML back-end will recognize the contents of \"@@h:<b>@@\" as
HTML code while every other back-end will ignore it."
:group 'org-export-general
:type '(repeat
(cons
Expand Down Expand Up @@ -2320,10 +2320,8 @@ Return code as a string."
(goto-char (point-min))
(forward-line)
(narrow-to-region (point) (point-max))))
;; 1. Get export environment from original buffer. Store
;; original footnotes definitions in communication channel as
;; they might not be accessible anymore in a narrowed parse
;; tree. Also install user's and developer's filters.
;; 1. Get export environment from original buffer. Also install
;; user's and developer's filters.
(let ((info (org-export-install-filters
(org-export-get-environment backend subtreep ext-plist)))
;; 2. Get parse tree. Buffer isn't parsed directly.
Expand Down
6 changes: 3 additions & 3 deletions testing/lisp/test-org-element.el
Expand Up @@ -470,7 +470,7 @@ CLOCK: [2012-01-01 sun. 00:01]--[2012-01-01 sun. 00:02] => 0:01"
(should
(equal
'("back-end" . "contents")
(org-test-with-temp-text "<back-end@contents>"
(org-test-with-temp-text "@@back-end:contents@@"
(org-element-map
(org-element-parse-buffer) 'export-snippet
(lambda (snippet) (cons (org-element-property :back-end snippet)
Expand Down Expand Up @@ -1758,8 +1758,8 @@ CLOSED: <2012-01-01> DEADLINE: <2012-01-01> SCHEDULED: <2012-01-01>\n"))))

(ert-deftest test-org-element/export-snippet-interpreter ()
"Test export snippet interpreter."
(should (equal (org-test-parse-and-interpret "<back-end@contents>")
"<back-end@contents>\n")))
(should (equal (org-test-parse-and-interpret "@@back-end:contents@@")
"@@back-end:contents@@\n")))

(ert-deftest test-org-element/footnote-reference-interpreter ()
"Test footnote reference interpreter."
Expand Down
2 changes: 1 addition & 1 deletion testing/lisp/test-org-export.el
Expand Up @@ -295,7 +295,7 @@ Paragraph"

(ert-deftest test-org-export/export-snippet ()
"Test export snippets transcoding."
(org-test-with-temp-text "<test@A><t@B>"
(org-test-with-temp-text "@@test:A@@@@t:B@@"
(org-test-with-backend test
(flet ((org-test-export-snippet
(snippet contents info)
Expand Down

0 comments on commit ab82a9d

Please sign in to comment.