mirror of
https://github.com/org-roam/org-roam
synced 2025-08-01 12:17:21 -05:00
(feat): Allow one file to have multiple roam_key statements (#1215)
This commit is contained in:
@ -71,6 +71,40 @@
|
||||
(expect (org-roam--str-to-list "\"hello")
|
||||
:to-throw)))
|
||||
|
||||
(describe "Ref 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
|
||||
;; Unlike tag extraction, it doesn't make sense to
|
||||
;; pass a filename.
|
||||
(funcall fn)))))
|
||||
;; Enable "cite:" link parsing
|
||||
(org-link-set-parameters "cite")
|
||||
(it "extracts web keys"
|
||||
(expect (test #'org-roam--extract-ref
|
||||
"web_ref.org")
|
||||
:to-equal
|
||||
'("website" . "//google.com/")))
|
||||
(it "extracts cite keys"
|
||||
(expect (test #'org-roam--extract-ref
|
||||
"cite_ref.org")
|
||||
:to-equal
|
||||
'("cite" . "mitsuha2007")))
|
||||
(it "extracts all keys"
|
||||
(expect (test #'org-roam--extract-refs
|
||||
"multiple-refs.org")
|
||||
:to-have-same-items-as
|
||||
'(("cite" . "orgroam2020")
|
||||
("website" . "//www.orgroam.com/"))))))
|
||||
|
||||
(describe "Title extraction"
|
||||
:var (org-roam-title-sources)
|
||||
(before-all
|
||||
|
Reference in New Issue
Block a user