123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101 |
- (require 'org-capture)
- (ert-deftest test-org-capture/fill-template ()
- "Test `org-capture-fill-template' specifications."
-
-
-
- (should
- (equal "success!\n"
- (org-capture-fill-template "%(concat \"success\" \"!\")")))
-
- (should
- (equal (concat (format-time-string "%Y") "\n")
- (org-capture-fill-template "%<%Y>")))
-
- (should
- (equal (concat (format-time-string (org-time-stamp-format nil nil)) "\n")
- (org-capture-fill-template "%t")))
- (should
- (equal (concat (format-time-string (org-time-stamp-format t nil)) "\n")
- (org-capture-fill-template "%T")))
-
- (should
- (equal
- (concat (format-time-string (org-time-stamp-format nil t)) "\n")
- (org-capture-fill-template "%u")))
- (should
- (equal
- (concat (format-time-string (org-time-stamp-format t t)) "\n")
- (org-capture-fill-template "%U")))
-
-
- (should
- (equal "success!\n"
- (let ((org-store-link-plist nil))
- (org-capture-fill-template "%i" "success!"))))
- (should
- (equal "%(concat \"no \" \"evaluation\")\n"
- (let ((org-store-link-plist nil))
- (org-capture-fill-template
- "%i" "%(concat \"no \" \"evaluation\")"))))
-
- (should
- (equal "%i\n"
- (let ((org-store-link-plist nil))
- (org-capture-fill-template "\\%i" "success!"))))
- (should
- (equal "\\success!\n"
- (let ((org-store-link-plist nil))
- (org-capture-fill-template "\\\\%i" "success!"))))
- (should
- (equal "\\%i\n"
- (let ((org-store-link-plist nil))
- (org-capture-fill-template "\\\\\\%i" "success!"))))
-
- (should
- (equal "success! success! success! success!\n"
- (let ((org-store-link-plist nil))
- (org-capture-fill-template "%i %i %i %i" "success!"))))
-
-
- (should
- (equal
- "5 % Less (See Item \"3)\" Somewhere)\n"
- (let ((org-store-link-plist nil))
- (org-capture-fill-template
- "%(capitalize \"%i\")"
- "5 % less (see item \"3)\" somewhere)")))))
- (provide 'test-org-capture)
|