org-num: Add tests

* testing/lisp/test-org-num.el (test-org-num/skip-numbering): Add
tests. This is a followup to 40474827ea.
This commit is contained in:
Nicolas Goaziou 2020-08-28 08:45:41 +02:00
parent 40474827ea
commit 66537267eb
1 changed files with 19 additions and 0 deletions

View File

@ -154,6 +154,25 @@
(org-test-with-temp-text
"* H1\n:PROPERTIES:\n:UNNUMBERED: t\n:END:\n** H2"
(let ((org-num-skip-unnumbered t)) (org-num-mode 1))
(mapcar (lambda (o) (overlay-get o 'after-string))
(overlays-in (point-min) (point-max))))))
;; Do not choke on empty headlines.
(should
(equal '("1 ")
(org-test-with-temp-text "* "
(let ((org-num-skip-commented t)) (org-num-mode 1))
(mapcar (lambda (o) (overlay-get o 'after-string))
(overlays-in (point-min) (point-max))))))
(should
(equal '("1 ")
(org-test-with-temp-text "* "
(let ((org-num-skip-unnumbered t)) (org-num-mode 1))
(mapcar (lambda (o) (overlay-get o 'after-string))
(overlays-in (point-min) (point-max))))))
(should
(equal '("1 ")
(org-test-with-temp-text "* "
(let ((org-num-skip-footnotes t)) (org-num-mode 1))
(mapcar (lambda (o) (overlay-get o 'after-string))
(overlays-in (point-min) (point-max)))))))