0
0
Fork 1
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-09-06 13:42:53 +00:00
org-mode/testing/lisp/test-ob.el

29 lines
1 KiB
EmacsLisp

;;; test-ob.el --- tests for ob.el
(require 'org-test)
(defmacro test-ob-in-code-block (marker &rest body)
(declare (indent 1))
`(in-org-example-file
(goto-char (point-min))
(re-search-forward (regexp-quote ,marker))
,@body))
(ert-deftest test-org-babel-get-src-block-info-language ()
(test-ob-in-code-block "94839181-184f-4ff4-a72f-94214df6f5ba"
(let ((info (org-babel-get-src-block-info)))
(should (string= "emacs-lisp" (nth 0 info))))))
(ert-deftest test-org-babel-get-src-block-info-body ()
(test-ob-in-code-block "94839181-184f-4ff4-a72f-94214df6f5ba"
(let ((info (org-babel-get-src-block-info)))
(should (string-match (regexp-quote "94839181-184f-4ff4-a72f-94214df6f5ba")
(nth 1 info))))))
(ert-deftest test-org-babel-get-src-block-info-tangle ()
(test-ob-in-code-block "94839181-184f-4ff4-a72f-94214df6f5ba"
(let ((info (org-babel-get-src-block-info)))
(should (string= "no" (cdr (assoc :tangle (nth 2 info))))))))
(provide 'test-ob)
;;; test-ob ends here