testing: Re-introduce more useful new tests instead of deleted dupllicates

* testing/lisp/test-ol.el (test-org-link/store-link):
* testing/lisp/test-org-table.el (test-org-table/get-field):
* testing/lisp/test-org.el (test-org/auto-fill-function): Add modified
version of the removed test duplicates, according to their likely
original intention.

Link: https://orgmode.org/list/87cz0wyw9m.fsf@localhost
This commit is contained in:
Ihor Radchenko 2023-08-08 15:40:59 +03:00
parent fe85d61a92
commit 173b5de0ec
No known key found for this signature in database
GPG Key ID: 6470762A7DA11D8B
3 changed files with 22 additions and 0 deletions

View File

@ -301,6 +301,14 @@ See https://github.com/yantar92/org/issues/4."
(let ((file (buffer-file-name)))
(equal (format "[[file:%s::two]]" file file)
(org-store-link nil))))))
(should
(let ((org-stored-links nil)
(org-context-in-file-links t))
(org-test-with-temp-text-in-file "#two"
(fundamental-mode)
(let ((file (buffer-file-name)))
(equal (format "[[file:%s::two]]" file file)
(org-store-link nil))))))
(should
(let ((org-stored-links nil)
(org-context-in-file-links t))

View File

@ -3368,6 +3368,11 @@ See also `test-org-table/copy-field'."
(org-test-with-temp-text "| 1 | 2 | 3 |"
(org-table-get-field 3 " foo ")
(buffer-string))))
(should
(equal " foo "
(org-test-with-temp-text "| 1 | 2 |\n<point>| 3 | 4 |"
(org-table-get-field 2 " foo ")
(org-table-get-field 2))))
;; An empty REPLACE string clears the field.
(should
(equal "| |"

View File

@ -1025,6 +1025,15 @@ Otherwise, evaluate RESULT as an sexp and return its result."
(end-of-line 3)
(org-auto-fill-function)
(buffer-string)))))
;; Do not fill VERSE blocks.
(should-not
(equal "#+BEGIN_VERSE\n12345\n7890\n#+END_VERSE"
(org-test-with-temp-text "#+BEGIN_VERSE\n12345 7890\n#+END_VERSE"
(let ((fill-column 5))
(forward-line)
(end-of-line)
(org-auto-fill-function)
(buffer-string)))))
;; Comment block: auto fill contents.
(should
(equal "#+BEGIN_COMMENT\n12345\n7890\n#+END_COMMENT"