* lisp/org.el (org-at-property-drawer-p): Fix typo.
* testing/lisp/test-org.el (test-org/at-property-drawer-p): Update
name and function calls.  Add a test.
This commit is contained in:
Nicolas Goaziou 2020-05-09 12:58:09 +02:00
parent 8580ef6ec1
commit ed0e75d241
2 changed files with 15 additions and 14 deletions

View File

@ -12474,7 +12474,7 @@ FORCE is non-nil, or return nil."
"Non-nil when point is at the first line of a property drawer."
(org-with-wide-buffer
(beginning-of-line)
(and (looking-at org-property-start-re)
(and (looking-at org-property-drawer-re)
(or (bobp)
(progn
(forward-line -1)

View File

@ -397,22 +397,23 @@
(org-test-with-temp-text ":PROPERTIES:\n<point>:PROP: t\n:END:\n"
(org-at-property-p)))))
(ert-deftest test-org/at-property-block-p ()
"Test `org-at-property-block-p' specifications."
(ert-deftest test-org/at-property-drawer-p ()
"Test `org-at-property-drawer-p' specifications."
(should
(equal 't
(org-test-with-temp-text "* H\n<point>:PROPERTIES:\n:PROP: t\n:END:\n"
(org-at-property-block-p))))
(org-test-with-temp-text "* H\n<point>:PROPERTIES:\n:PROP: t\n:END:\n"
(org-at-property-drawer-p)))
(should
(equal 't
(org-test-with-temp-text ":PROPERTIES:\n:PROP: t\n:END:\n"
(org-at-property-block-p))))
;; The function only returns t if point is at the first line of a
;; property block.
(org-test-with-temp-text ":PROPERTIES:\n:PROP: t\n:END:\n"
(org-at-property-drawer-p)))
;; The function only returns t if point is at the first line of
;; a property block.
(should-not
(equal 't
(org-test-with-temp-text ":PROPERTIES:\n<point>:PROP: t\n:END:\n"
(org-at-property-block-p)))))
(org-test-with-temp-text ":PROPERTIES:\n<point>:PROP: t\n:END:\n"
(org-at-property-drawer-p)))
;; The function ignores incomplete drawers.
(should-not
(org-test-with-temp-text ":PROPERTIES:\n<point>:PROP: t\n"
(org-at-property-drawer-p))))
(ert-deftest test-org/get-property-block ()
"Test `org-get-property-block' specifications."