diff options
author | Nicolas Goaziou <mail@nicolasgoaziou.fr> | 2017-11-01 17:54:12 +0100 |
---|---|---|
committer | Nicolas Goaziou <mail@nicolasgoaziou.fr> | 2017-11-03 22:15:41 +0100 |
commit | ee3a9e9a77e5173cc1c31672280bc29a69b6a390 (patch) | |
tree | c70f3a1e0834eed509b63adb411814ea9a8e347b | |
parent | 902bfe189254819b2a782b4186bf2c94fc0f6c2d (diff) | |
download | org-mode-ee3a9e9a77e5173cc1c31672280bc29a69b6a390.tar.gz |
Fix failing test
* testing/lisp/test-ox-publish.el (test-org-publish/resolve-external-link):
Rewrite test to prevent race condition which could affect results.
* testing/examples/pub/b.org: Add missing keyword.
-rw-r--r-- | testing/examples/pub/b.org | 3 | ||||
-rw-r--r-- | testing/lisp/test-ox-publish.el | 34 |
2 files changed, 21 insertions, 16 deletions
diff --git a/testing/examples/pub/b.org b/testing/examples/pub/b.org index 6038746..261152e 100644 --- a/testing/examples/pub/b.org +++ b/testing/examples/pub/b.org @@ -2,5 +2,8 @@ #+date: <2012-03-29 Thu> * Headline1 +:PROPERTIES: +:CUSTOM_ID: b1 +:END: [[file:a.org::#a1]] diff --git a/testing/lisp/test-ox-publish.el b/testing/lisp/test-ox-publish.el index a511905..0c3aaed 100644 --- a/testing/lisp/test-ox-publish.el +++ b/testing/lisp/test-ox-publish.el @@ -366,27 +366,29 @@ Unless set otherwise in PROPERTIES, `:base-directory' is set to ;; instead of internal reference, whenever possible. (should (equal - "a1" + '("a1" "b1") (let* ((ids nil) + (link-transcoder + (lambda (l c i) + (let ((option (org-element-property :search-option l)) + (path (org-element-property :path l))) + (push (org-publish-resolve-external-link option path t) + ids) + ""))) (backend (org-export-create-backend - :transcoders - '((headline . (lambda (h c i) c)) - (paragraph . (lambda (p c i) c)) - (section . (lambda (s c i) c)) - (link . (lambda (l c i) - (let ((option (org-element-property :search-option l)) - (path (org-element-property :path l))) - (when option - (throw :exit (org-publish-resolve-external-link - option path t))))))))) + :transcoders `((headline . (lambda (h c i) c)) + (paragraph . (lambda (p c i) c)) + (section . (lambda (s c i) c)) + (link . ,link-transcoder)))) (publish (lambda (plist filename pub-dir) - (push (catch :exit - (org-publish-org-to backend filename ".test" plist pub-dir)) - ids)))) - (org-test-publish (list :publishing-function (list publish)) #'ignore) - (car ids))))) + (org-publish-org-to backend filename ".test" plist pub-dir)))) + (org-test-publish (list :publishing-function (list publish) + :exclude "." + :include '("a.org" "b.org")) + #'ignore) + (sort ids #'string<))))) ;;; Tools |