mirror of
https://git.savannah.gnu.org/git/emacs/org-mode.git
synced 2024-08-25 10:32:52 +00:00
testing/lisp/test-org-colview.el: Add tests
* test-org-colview.el (test-org-colview/uncompile-format, test-org-colview/compile-format): Add tests for functions: `org-columns-uncompile-format' & `org-columns-compile-format'.
This commit is contained in:
parent
cfb2ddab11
commit
03afd25582
|
@ -26,6 +26,72 @@
|
|||
(require 'org-duration)
|
||||
(require 'org-inlinetask)
|
||||
|
||||
(ert-deftest test-org-colview/uncompile-format ()
|
||||
"Test `org-columns-uncompile-format' specifications."
|
||||
;; With minimum data, one element
|
||||
(should
|
||||
(equal "%ITEM"
|
||||
(org-columns-uncompile-format '(("ITEM" "ITEM" nil nil nil)))))
|
||||
;; With minimum data, two element
|
||||
(should
|
||||
(equal "%ITEM %TODO"
|
||||
(org-columns-uncompile-format
|
||||
`(("ITEM" "ITEM" nil nil nil) ("TODO" "TODO" nil nil nil)))))
|
||||
;; Read width
|
||||
(should
|
||||
(equal "%10ITEM"
|
||||
(org-columns-uncompile-format `(("ITEM" "ITEM" 10 nil nil)))))
|
||||
;; Read title
|
||||
(should
|
||||
(equal "%ITEM(some title)"
|
||||
(org-columns-uncompile-format `(("ITEM" "some title" nil nil nil)))))
|
||||
;; Read operator
|
||||
(should
|
||||
(equal "%ITEM{+}"
|
||||
(org-columns-uncompile-format `(("ITEM" "ITEM" nil "+" nil)))))
|
||||
;; Read operator printf
|
||||
(should
|
||||
(equal "%ITEM{+;%.1f}"
|
||||
(org-columns-uncompile-format `(("ITEM" "ITEM" nil "+" "%.1f"))))))
|
||||
|
||||
(ert-deftest test-org-colview/compile-format ()
|
||||
"Test `org-columns-compile-format' specifications."
|
||||
;; With minimum data, one element
|
||||
(should
|
||||
(equal `(("ITEM" "ITEM" nil nil nil))
|
||||
(org-columns-compile-format
|
||||
"%ITEM")))
|
||||
;; With minimum data, two element
|
||||
(should
|
||||
(equal `(("ITEM" "ITEM" nil nil nil) ("TODO" "TODO" nil nil nil))
|
||||
(org-columns-compile-format
|
||||
"%ITEM %TODO")))
|
||||
;; Read width
|
||||
(should
|
||||
(equal `(("ITEM" "ITEM" 10 nil nil))
|
||||
(org-columns-compile-format
|
||||
"%10ITEM")))
|
||||
;; Upcase property name
|
||||
(should
|
||||
(equal `(("ITEM" "item" nil nil nil))
|
||||
(org-columns-compile-format
|
||||
"%item")))
|
||||
;; Read title
|
||||
(should
|
||||
(equal `(("ITEM" "some title" nil nil nil))
|
||||
(org-columns-compile-format
|
||||
"%ITEM(some title)")))
|
||||
;; Read operator
|
||||
(should
|
||||
(equal `(("ITEM" "ITEM" nil "+" nil))
|
||||
(org-columns-compile-format
|
||||
"%ITEM{+}")))
|
||||
;; Read operator printf
|
||||
(should
|
||||
(equal `(("ITEM" "ITEM" nil "+" "%.1f"))
|
||||
(org-columns-compile-format
|
||||
"%ITEM{+;%.1f}"))))
|
||||
|
||||
(ert-deftest test-org-colview/get-format ()
|
||||
"Test `org-columns-get-format' specifications."
|
||||
;; Without any clue, use `org-columns-default-format'.
|
||||
|
|
Loading…
Reference in a new issue