From 66537267ebdd278ad026214b7479478ddb64b043 Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Fri, 28 Aug 2020 08:45:41 +0200 Subject: [PATCH] org-num: Add tests * testing/lisp/test-org-num.el (test-org-num/skip-numbering): Add tests. This is a followup to 40474827eade4ab4d3667b4dde5f0833562c7b87. --- testing/lisp/test-org-num.el | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/testing/lisp/test-org-num.el b/testing/lisp/test-org-num.el index e4f3cbc6d..7a247b04a 100644 --- a/testing/lisp/test-org-num.el +++ b/testing/lisp/test-org-num.el @@ -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)))))))