(tests): add test for headline extraction (#840)
This commit is contained in:
parent
1276e801c0
commit
185f9877ae
2 changed files with 34 additions and 0 deletions
14
tests/roam-files/headlines/headline.org
Normal file
14
tests/roam-files/headlines/headline.org
Normal file
|
@ -0,0 +1,14 @@
|
|||
#+TITLE: Headline
|
||||
|
||||
* Headline 1
|
||||
:PROPERTIES:
|
||||
:ID: e84d0630-efad-4017-9059-5ef917908823
|
||||
:END:
|
||||
|
||||
* No headline here
|
||||
Oops.
|
||||
|
||||
* Headline 2
|
||||
:PROPERTIES:
|
||||
:ID: 801b58eb-97e2-435f-a33e-ff59a2f0c213
|
||||
:END:
|
|
@ -225,6 +225,26 @@
|
|||
:to-equal
|
||||
'("t1" "t2 with space" "t3" "tags"))))))
|
||||
|
||||
(describe "Headline extraction"
|
||||
(before-all
|
||||
(test-org-roam--init))
|
||||
|
||||
(after-all
|
||||
(test-org-roam--teardown))
|
||||
|
||||
(cl-flet
|
||||
((test (fn file)
|
||||
(let* ((fname (test-org-roam--abs-path file))
|
||||
(buf (find-file-noselect fname)))
|
||||
(with-current-buffer buf
|
||||
(funcall fn fname)))))
|
||||
(it "extracts headlines"
|
||||
(expect (test #'org-roam--extract-headlines
|
||||
"headlines/headline.org")
|
||||
:to-equal
|
||||
`(["e84d0630-efad-4017-9059-5ef917908823" ,(test-org-roam--abs-path "headlines/headline.org")]
|
||||
["801b58eb-97e2-435f-a33e-ff59a2f0c213" ,(test-org-roam--abs-path "headlines/headline.org")])))))
|
||||
|
||||
;;; Tests
|
||||
(xdescribe "org-roam-db-build-cache"
|
||||
(before-each
|
||||
|
|
Loading…
Reference in a new issue