test-ob-lob.el 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. ;;; test-ob-lob.el
  2. ;; Copyright (c) 2010 Eric Schulte
  3. ;; Authors: Eric Schulte
  4. ;; Released under the GNU General Public License version 3
  5. ;; see: http://www.gnu.org/licenses/gpl-3.0.html
  6. ;;;; Comments:
  7. ;; Template test file for Org-mode tests
  8. ;;; Code:
  9. (let ((load-path (cons (expand-file-name
  10. ".." (file-name-directory
  11. (or load-file-name buffer-file-name)))
  12. load-path)))
  13. (require 'org-test)
  14. (require 'org-test-ob-consts))
  15. ;;; Tests
  16. (ert-deftest test-ob-lob/ingest ()
  17. "Test the ingestion of an org-mode file."
  18. (should (< 0 (org-babel-lob-ingest
  19. (expand-file-name "babel.org" org-test-example-dir)))))
  20. (ert-deftest test-ob-lob/call-with-header-arguments ()
  21. "Test the evaluation of a library of babel #+call: line."
  22. (org-test-at-marker
  23. (expand-file-name "babel.org" org-test-example-dir)
  24. "69fbe856-ca9c-4f20-9146-826d2f488c1d"
  25. (move-beginning-of-line 1)
  26. (forward-line 1)
  27. (message (buffer-substring (point-at-bol) (point-at-eol)))
  28. (should (string= "testing" (org-babel-lob-execute
  29. (org-babel-lob-get-info))))
  30. (forward-line 1)
  31. (should (string= "testing" (caar (org-babel-lob-execute
  32. (org-babel-lob-get-info)))))
  33. (forward-line 1)
  34. (should (string= "testing" (org-babel-lob-execute
  35. (org-babel-lob-get-info))))
  36. (forward-line 1)
  37. (should (string= "testing" (caar (org-babel-lob-execute
  38. (org-babel-lob-get-info)))))))
  39. (provide 'test-ob-lob)
  40. ;;; test-ob-lob.el ends here