mirror of
https://github.com/org-roam/org-roam
synced 2025-08-01 12:17:21 -05:00
(feature): add a cache for ROAM_KEY (#192)
This commit is contained in:
@ -72,7 +72,8 @@
|
||||
(oset obj initialized t)
|
||||
(oset obj forward-links (plist-get cache :forward))
|
||||
(oset obj backward-links (plist-get cache :backward))
|
||||
(oset obj titles (plist-get cache :titles)))))
|
||||
(oset obj titles (plist-get cache :titles))
|
||||
(oset obj refs (plist-get cache :refs)))))
|
||||
|
||||
;;; Tests
|
||||
(describe "org-roam--build-cache-async"
|
||||
@ -92,6 +93,7 @@
|
||||
(expect (hash-table-count (org-roam--forward-links-cache)) :to-be 4)
|
||||
(expect (hash-table-count (org-roam--backward-links-cache)) :to-be 5)
|
||||
(expect (hash-table-count (org-roam--titles-cache)) :to-be 6)
|
||||
(expect (hash-table-count (org-roam--refs-cache)) :to-be 1)
|
||||
|
||||
;; Forward cache
|
||||
(let ((f1 (gethash (abs-path "f1.org")
|
||||
@ -148,6 +150,10 @@
|
||||
(expect (gethash (abs-path "no-title.org")
|
||||
(org-roam--titles-cache)) :to-be nil)
|
||||
|
||||
;; Refs Cache
|
||||
(expect (gethash "https://google.com/"
|
||||
(org-roam--refs-cache)) :to-equal (abs-path "web_ref.org"))
|
||||
|
||||
;; Multi
|
||||
(let ((org-roam-directory org-roam-directory2))
|
||||
(org-roam--build-cache-async)
|
||||
|
Reference in New Issue
Block a user