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.
This commit is contained in:
Ihor Radchenko 2022-09-16 11:30:16 +08:00
parent 17b51973bd
commit 6074a22bcb
No known key found for this signature in database
GPG Key ID: 6470762A7DA11D8B
7 changed files with 13 additions and 20 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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