mirror of
https://github.com/org-roam/org-roam
synced 2025-08-01 12:17:21 -05:00
(tests): add test for headline extraction (#840)
This commit is contained in:
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
|
:to-equal
|
||||||
'("t1" "t2 with space" "t3" "tags"))))))
|
'("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
|
;;; Tests
|
||||||
(xdescribe "org-roam-db-build-cache"
|
(xdescribe "org-roam-db-build-cache"
|
||||||
(before-each
|
(before-each
|
||||||
|
Reference in New Issue
Block a user