test-ob-lob.el 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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-id "fab7e291-fde6-45fc-bf6e-a485b8bca2f0"
  23. (move-beginning-of-line 1)
  24. (forward-line 6)
  25. (message (buffer-substring (point-at-bol) (point-at-eol)))
  26. (should (string= "testing" (org-babel-lob-execute
  27. (org-babel-lob-get-info))))
  28. (forward-line 1)
  29. (should (string= "testing" (caar (org-babel-lob-execute
  30. (org-babel-lob-get-info)))))
  31. (forward-line 1)
  32. (should (string= "testing" (org-babel-lob-execute
  33. (org-babel-lob-get-info))))
  34. (forward-line 1)
  35. (should (string= "testing" (caar (org-babel-lob-execute
  36. (org-babel-lob-get-info)))))
  37. (forward-line 1)
  38. (should (string= "testing" (org-babel-lob-execute
  39. (org-babel-lob-get-info))))
  40. (forward-line 1)
  41. (should (string= "testing" (caar (org-babel-lob-execute
  42. (org-babel-lob-get-info)))))
  43. (forward-line 1) (beginning-of-line) (forward-char 27)
  44. (should (string= "testing" (org-babel-lob-execute
  45. (org-babel-lob-get-info))))
  46. (forward-line 1) (beginning-of-line) (forward-char 27)
  47. (should (string= "testing" (caar (org-babel-lob-execute
  48. (org-babel-lob-get-info)))))
  49. (forward-line 1) (beginning-of-line)
  50. (should (= 4 (org-babel-lob-execute (org-babel-lob-get-info))))
  51. (forward-line 1)
  52. (should (string= "testing" (org-babel-lob-execute
  53. (org-babel-lob-get-info))))))
  54. (provide 'test-ob-lob)
  55. ;;; test-ob-lob.el ends here