summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <n.goaziou@gmail.com>2013-08-12 08:42:05 (GMT)
committer Nicolas Goaziou <n.goaziou@gmail.com>2013-08-12 08:42:05 (GMT)
commitcf8cc35ec55e1c309495c760c1e392bf12506c61 (patch)
treee91360836f352cc85bd0c33917088db3b68b6980
parent2a28def0ae480f1dec3fa44f6cd87d1c31bec1af (diff)
downloadorg-mode-cf8cc35ec55e1c309495c760c1e392bf12506c61.zip
org-mode-cf8cc35ec55e1c309495c760c1e392bf12506c61.tar.gz
ox: Fix test errors
* lisp/ox.el (org-export-data-with-backend): Set temporary back-end as the new back-end in local communication channel. (org-export-filter-apply-functions): Handle corner case where back-end is nil. * testing/lisp/test-ox.el: Small refactoring.
-rw-r--r--lisp/ox.el8
-rw-r--r--testing/lisp/test-ox.el69
2 files changed, 38 insertions, 39 deletions
diff --git a/lisp/ox.el b/lisp/ox.el
index d0ccc1e..12a7475 100644
--- a/lisp/ox.el
+++ b/lisp/ox.el
@@ -2250,9 +2250,10 @@ recursively convert DATA using BACKEND translation table."
;; memoization.
(org-combine-plists
info
- (list :translate-alist (org-export-get-all-transcoders backend)
+ (list :back-end backend
+ :translate-alist (org-export-get-all-transcoders backend)
;; Size of the hash table is reduced since this function
- ;; will probably be used on short trees.
+ ;; will probably be used on small trees.
:exported-data (make-hash-table :test 'eq :size 401)))))
(defun org-export--interpret-p (blob info)
@@ -2754,7 +2755,8 @@ VALUE is ignored.
Call is done in a LIFO fashion, to be sure that developer
specified filters, if any, are called first."
(catch 'exit
- (let ((backend-name (org-export-backend-name (plist-get info :back-end))))
+ (let* ((backend (plist-get info :back-end))
+ (backend-name (and backend (org-export-backend-name backend))))
(dolist (filter filters value)
(let ((result (funcall filter value backend-name info)))
(cond ((not result) value)
diff --git a/testing/lisp/test-ox.el b/testing/lisp/test-ox.el
index abe980c..289cf07 100644
--- a/testing/lisp/test-ox.el
+++ b/testing/lisp/test-ox.el
@@ -2246,51 +2246,48 @@ Another text. (ref:text)
(ert-deftest test-org-export/table-cell-alignment ()
"Test `org-export-table-cell-alignment' specifications."
- (let ((org-table-number-fraction 0.5)
- (org-table-number-regexp "^[0-9]+$"))
- ;; 1. Alignment is primarily determined by alignment cookies.
- (org-test-with-temp-text "| <l> | <c> | <r> |"
- (let* ((tree (org-element-parse-buffer))
- (info `(:parse-tree ,tree)))
- (should
- (equal
- '(left center right)
- (mapcar (lambda (cell) (org-export-table-cell-alignment cell info))
- (org-element-map tree 'table-cell 'identity))))))
- ;; 2. The last alignment cookie has precedence.
- (org-test-with-parsed-data "
+ ;; 1. Alignment is primarily determined by alignment cookies.
+ (should
+ (equal '(left center right)
+ (let ((org-table-number-fraction 0.5)
+ (org-table-number-regexp "^[0-9]+$"))
+ (org-test-with-parsed-data "| <l> | <c> | <r> |"
+ (mapcar (lambda (cell)
+ (org-export-table-cell-alignment cell info))
+ (org-element-map tree 'table-cell 'identity))))))
+ ;; 2. The last alignment cookie has precedence.
+ (should
+ (equal '(right right right)
+ (org-test-with-parsed-data "
| <l8> |
| cell |
| <r9> |"
- (should
- (equal
- '(right right right)
- (mapcar (lambda (cell) (org-export-table-cell-alignment cell info))
- (org-element-map tree 'table-cell 'identity)))))
- ;; 3. If there's no cookie, cell's contents determine alignment.
- ;; A column mostly made of cells containing numbers will align
- ;; its cells to the right.
- (org-test-with-parsed-data "
+ (mapcar (lambda (cell) (org-export-table-cell-alignment cell info))
+ (org-element-map tree 'table-cell 'identity)))))
+ ;; 3. If there's no cookie, cell's contents determine alignment.
+ ;; A column mostly made of cells containing numbers will align
+ ;; its cells to the right.
+ (should
+ (equal '(right right right)
+ (let ((org-table-number-fraction 0.5)
+ (org-table-number-regexp "^[0-9]+$"))
+ (org-test-with-parsed-data "
| 123 |
| some text |
| 12345 |"
- (should
- (equal
- '(right right right)
- (mapcar (lambda (cell)
- (org-export-table-cell-alignment cell info))
- (org-element-map tree 'table-cell 'identity)))))
- ;; 4. Otherwise, they will be aligned to the left.
- (org-test-with-parsed-data "
+ (mapcar (lambda (cell)
+ (org-export-table-cell-alignment cell info))
+ (org-element-map tree 'table-cell 'identity))))))
+ ;; 4. Otherwise, they will be aligned to the left.
+ (should
+ (equal '(left left left)
+ (org-test-with-parsed-data "
| text |
| some text |
| \alpha |"
- (should
- (equal
- '(left left left)
- (mapcar (lambda (cell)
- (org-export-table-cell-alignment cell info))
- (org-element-map tree 'table-cell 'identity)))))))
+ (mapcar (lambda (cell)
+ (org-export-table-cell-alignment cell info))
+ (org-element-map tree 'table-cell 'identity info))))))
(ert-deftest test-org-export/table-cell-borders ()
"Test `org-export-table-cell-borders' specifications."