test-ob-tangle.el 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. ;;; test-ob-tangle.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. ;; TODO
  17. ;; (ert-deftest ob-tangle/noweb-on-tangle ()
  18. ;; "Noweb header arguments tangle correctly.
  19. ;; - yes expand on both export and tangle
  20. ;; - no expand on neither export or tangle
  21. ;; - tangle expand on only tangle not export"
  22. ;; (let ((target-file (make-temp-file "ob-tangle-test-")))
  23. ;; (org-test-at-id "eb1f6498-5bd9-45e0-9c56-50717053e7b7"
  24. ;; (org-narrow-to-subtree)
  25. ;; (org-babel-tangle target-file))
  26. ;; (let ((tang (with-temp-buffer
  27. ;; (insert-file-contents target-file)
  28. ;; (buffer-string))))
  29. ;; (flet ((exp-p (arg)
  30. ;; (and
  31. ;; (string-match
  32. ;; (format "noweb-%s-start\\([^\000]*\\)noweb-%s-end" arg arg)
  33. ;; tang)
  34. ;; (string-match "expanded" (match-string 1 tang)))))
  35. ;; (should (exp-p "yes"))
  36. ;; (should-not (exp-p "no"))
  37. ;; (should (exp-p "tangle"))))))
  38. (ert-deftest ob-tangle/no-excessive-id-insertion-on-tangle ()
  39. "Don't add IDs to headings without tangling code blocks."
  40. (org-test-at-id "ef06fd7f-012b-4fde-87a2-2ae91504ea7e"
  41. (org-babel-next-src-block)
  42. (org-babel-tangle)
  43. (should (null (org-id-get)))))
  44. (provide 'test-ob-tangle)
  45. ;;; test-ob-tangle.el ends here