From 6074a22bcb25593bd7644b2695d38f8b41200463 Mon Sep 17 00:00:00 2001 From: Ihor Radchenko Date: Fri, 16 Sep 2022 11:30:16 +0800 Subject: [PATCH] testing: Address FIXMEs identified in 1a5e3f931 * testing/lisp/test-ob.el (test-ob/blocks-with-spaces): (test-ob/specific-colnames): * testing/lisp/test-oc.el (test-org-cite/export-capability): * testing/lisp/test-ol.el (test-org-link/store-link): * testing/lisp/test-org.el (test-org/set-regexps-and-options): * testing/org-test.el (org-test-base-dir): Address typos and non-existent variables. (missing-test-dependency): Use `define-error'. (org-test-load): Set `org-id-locations-file' when running tests. * testing/lisp/test-ox.el (test-org-export/bind-keyword): Clarify about variable symbol defined inside setupfile #+BIND statemtn. --- testing/lisp/test-ob.el | 6 ++---- testing/lisp/test-oc.el | 4 ++-- testing/lisp/test-ol.el | 1 - testing/lisp/test-org-agenda.el | 2 +- testing/lisp/test-org.el | 2 +- testing/lisp/test-ox.el | 2 +- testing/org-test.el | 16 ++++++---------- 7 files changed, 13 insertions(+), 20 deletions(-) diff --git a/testing/lisp/test-ob.el b/testing/lisp/test-ob.el index 3e7774a66..7fa330fe1 100644 --- a/testing/lisp/test-ob.el +++ b/testing/lisp/test-ob.el @@ -1389,8 +1389,7 @@ Line 3\" (org-test-with-temp-text "#+BEGIN_SRC emacs-lisp \(+ 1 2) #+END_SRC\n\n\n" - ;; FIXME: Unknown var `org-babel-next-src-block'? - (let ((org-babel-next-src-block "RESULTS")) + (let ((org-babel-results-keyword "RESULTS")) (org-babel-execute-src-block)) (buffer-string)))) ;; Do not add spurious blank lines after results. @@ -1543,8 +1542,7 @@ echo \"$data\" (should (re-search-forward org-babel-src-block-regexp nil t)) (goto-char (match-beginning 0)) ;; now that we've located the code block, it may be evaluated - ;; FIXME: Unknown var `org-babel-execute-src-block'? - (let ((org-babel-execute-src-block "RESULTS")) + (let ((org-babel-results-keyword "RESULTS")) (org-babel-execute-src-block)) (buffer-string))))) diff --git a/testing/lisp/test-oc.el b/testing/lisp/test-oc.el index 4b581880b..4a39874a8 100644 --- a/testing/lisp/test-oc.el +++ b/testing/lisp/test-oc.el @@ -1591,7 +1591,7 @@ arguments. Replace citation with \"@\" character in the output." '(p1 p1 p1 p3) (org-test-with-temp-text "[cite:@a]" (let ((org-export-registered-backends nil) - (org-cite--procesors nil) ;FIXME: `org-cite--processors' maybe? + (org-cite--processors nil) (org-cite-export-processors '((b1 . (p1)) (t . (p3))))) @@ -1612,7 +1612,7 @@ arguments. Replace citation with \"@\" character in the output." (eq 'p2 (org-test-with-temp-text "#+cite_export: p2\n[cite:@a]" (let ((org-export-registered-backends nil) - (org-cite--procesors nil) ;FIXME: `org-cite--processors' maybe? + (org-cite--processors nil) (org-cite-export-processors '((t . (p1))))) (org-cite-register-processor 'p1 :export-citation (lambda (&rest _) (throw :exit 'p1))) diff --git a/testing/lisp/test-ol.el b/testing/lisp/test-ol.el index 0fbb08460..a38d9f979 100644 --- a/testing/lisp/test-ol.el +++ b/testing/lisp/test-ol.el @@ -153,7 +153,6 @@ See https://github.com/yantar92/org/issues/4." (ert-deftest test-org-link/store-link () "Test `org-store-link' specifications." - (defvar org-store-link-props) ;; FIXME: Unknown var! ;; On a headline, link to that headline. Use heading as the ;; description of the link. (should diff --git a/testing/lisp/test-org-agenda.el b/testing/lisp/test-org-agenda.el index 12c868186..ed178a4c9 100644 --- a/testing/lisp/test-org-agenda.el +++ b/testing/lisp/test-org-agenda.el @@ -295,7 +295,7 @@ functions." `((?P ;; Custom bulk function ,(lambda (&rest args) - (message "test" args) ;FIXME: `args' unused? + (message "test") (setq f-called-cnt (1+ f-called-cnt) f-called-args args)) diff --git a/testing/lisp/test-org.el b/testing/lisp/test-org.el index 7e523be00..3c8ff4bb8 100644 --- a/testing/lisp/test-org.el +++ b/testing/lisp/test-org.el @@ -2670,7 +2670,7 @@ SCHEDULED: <2014-03-04 tue.>" org-current-tag-alist)))) (should (equal '(("A" . ?a) ("B") ("C")) - (let ((org-tag-persistant-alist nil)) ;FIXME: persist*e*nt, maybe? + (let ((org-tag-persistent-alist nil)) (org-test-with-temp-text "#+TAGS: A(a) B C" (org-mode-restart) org-current-tag-alist)))) diff --git a/testing/lisp/test-ox.el b/testing/lisp/test-ox.el index 4a060e268..573dbc6a5 100644 --- a/testing/lisp/test-ox.el +++ b/testing/lisp/test-ox.el @@ -93,7 +93,7 @@ variable, and communication channel under `info'." (format "#+SETUPFILE: \"%s/examples/setupfile.org\"" org-test-dir) (let ((org-export-allow-bind-keywords t)) (org-export-get-environment) - ;; FIXME: `variable'? + ;; `variable' is bound inside the setupfile. (eq variable 'value)))) ;; Verify that bound variables are seen during export. (should diff --git a/testing/org-test.el b/testing/org-test.el index 30f96d1f2..9f7bab9ea 100644 --- a/testing/org-test.el +++ b/testing/org-test.el @@ -78,7 +78,7 @@ org-test searches this directory up the directory tree.") (defconst org-test-dir (expand-file-name (file-name-directory (or load-file-name buffer-file-name)))) -(defconst org-base-dir ;; FIXME: Use `org-test-' prefix. +(defconst org-test-base-dir (expand-file-name ".." org-test-dir)) (defconst org-test-example-dir @@ -96,15 +96,9 @@ org-test searches this directory up the directory tree.") (defconst org-test-link-in-heading-file (expand-file-name "link-in-heading.org" org-test-dir)) -;; FIXME: Merely loading a file shouldn't override a user's settings. -(setq org-id-locations-file - (expand-file-name ".test-org-id-locations" org-test-dir)) - ;;; Functions for writing tests -(put 'missing-test-dependency ;FIXME: Use `define-error'. - 'error-conditions - '(error missing-test-dependency)) +(define-error 'missing-test-dependency "org-test: Test dependency missing.") (defun org-test-for-executable (exe) "Throw an error if EXE is not available. @@ -331,10 +325,10 @@ Tramp related features. We mostly follow ("lisp/\\1.el" . "testing/lisp/\\1.el/test.*.el") ("testing/lisp/test-\\1.el" . "lisp/\\1.el") ("testing/lisp/\\1.el" . "lisp/\\1.el/test.*.el")) - (concat org-base-dir "/") + (concat org-test-base-dir "/") "Jump between Org files and their tests." (lambda (path) - (let* ((full-path (expand-file-name path org-base-dir)) + (let* ((full-path (expand-file-name path org-test-base-dir)) (file-name (file-name-nondirectory path)) (name (file-name-sans-extension file-name))) (find-file full-path) @@ -392,6 +386,8 @@ Tramp related features. We mostly follow (defun org-test-load () "Load up the Org test suite." (interactive) + (setq org-id-locations-file + (expand-file-name ".test-org-id-locations" org-test-dir)) (cl-flet ((rld (base) ;; Recursively load all files, if files throw errors ;; then silently ignore the error and continue to the