diff options
author | Nicolas Petton | 2021-03-19 13:27:19 +0100 |
---|---|---|
committer | GitHub | 2021-03-19 13:27:19 +0100 |
commit | 9c75bb316bb8769a9cb7a6f6c11225ba482befbd (patch) | |
tree | 894fae73bd2078b5a719a85702f11d2012ebf6e8 /tests/nroam-test.el | |
parent | e6bd64814e4cb3b2ef0168b05245618eea435276 (diff) | |
parent | d7de243272f3f2bf7177ad81c5137b4ad97c15dd (diff) | |
download | nroam-9c75bb316bb8769a9cb7a6f6c11225ba482befbd.tar.gz nroam-9c75bb316bb8769a9cb7a6f6c11225ba482befbd.zip |
Merge pull request #24 from NicolasPetton/add-goto-section
Add nroam-goto
Diffstat (limited to 'tests/nroam-test.el')
-rw-r--r-- | tests/nroam-test.el | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/tests/nroam-test.el b/tests/nroam-test.el index 63e5b8a..c9a8a05 100644 --- a/tests/nroam-test.el +++ b/tests/nroam-test.el @@ -39,16 +39,26 @@ Execute BODY and cleanup the file and buffer after that." (nroam-test-with-temp-file-buffer (insert "foo")) +(defconst nroam-test-main-section-regexp "^* Backlinks") + (describe "nroam" - (describe "nroam-more" + (describe "nroam-mode" (it "creates nroam sections immediately" (nroam-test-with-temp-file-buffer (insert "#+title: my notes\n") (nroam-mode) (setf (point) (point-min)) - (let ((section-position (re-search-forward "^* Backlinks" nil t))) + (let ((section-position (re-search-forward nroam-test-main-section-regexp nil t))) (expect section-position :not :to-be nil) - (expect section-position :to-be-greater-than 10)))))) + (expect section-position :to-be-greater-than 10))))) + (describe "nroam-goto" + (it "moves point if nroam heading is present" + (nroam-test-with-temp-file-buffer + (insert "nroam is great\n") + (nroam-update) + (setf (point) (point-min)) + (nroam-goto) + (expect (looking-at-p nroam-test-main-section-regexp) :to-be t))))) (provide 'nroam-test) ;;; nroam-test.el ends here |