test-ob-header-arg-defaults.el 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. ;;; test-ob-header-arg-defaults.el --- tests for default header args from properties
  2. ;; Copyright (c) 2013, 2014 Achim Gratz
  3. ;; Authors: Achim Gratz
  4. ;; This file is not part of GNU Emacs.
  5. ;; This program is free software; you can redistribute it and/or modify
  6. ;; it under the terms of the GNU General Public License as published by
  7. ;; the Free Software Foundation, either version 3 of the License, or
  8. ;; (at your option) any later version.
  9. ;; This program is distributed in the hope that it will be useful,
  10. ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. ;; GNU General Public License for more details.
  13. ;; You should have received a copy of the GNU General Public License
  14. ;; along with this program. If not, see <http://www.gnu.org/licenses/>.
  15. ;;; Code:
  16. (ert-deftest test-ob-header-arg-defaults/global/call ()
  17. (org-test-at-id "3fdadb69-5d15-411e-aad0-f7860cdd7816"
  18. (org-babel-next-src-block 1)
  19. (forward-line -1)
  20. (should (equal "ge1/gh2/--3/ge4/ge5/--6/--7/--8/--9"
  21. (org-babel-execute-src-block nil (org-babel-lob-get-info))))))
  22. (ert-deftest test-ob-header-arg-defaults/global/noweb ()
  23. (org-test-at-id "3fdadb69-5d15-411e-aad0-f7860cdd7816"
  24. (org-babel-next-src-block 1)
  25. (should (equal "ge1/gh2/--3/ge4/ge5/--6/--7"
  26. (org-babel-execute-src-block)))))
  27. (ert-deftest test-ob-header-arg-defaults/tree/overwrite/call ()
  28. (should
  29. (equal "ge1/gh2/--3/ge4/ge5/--6/th7/te8/--9"
  30. (org-test-at-id "a9cdfeda-9f31-4bb5-b694-2cf452f07dfd"
  31. (org-babel-next-src-block 1)
  32. (forward-line -1)
  33. (org-babel-execute-src-block nil (org-babel-lob-get-info))))))
  34. (ert-deftest test-ob-header-arg-defaults/tree/overwrite/noweb ()
  35. (should
  36. (equal "--1/--2/--3/--4/--5/--6/th7/te8/--9"
  37. (org-test-at-id "a9cdfeda-9f31-4bb5-b694-2cf452f07dfd"
  38. (org-babel-next-src-block 1)
  39. (org-babel-execute-src-block)))))
  40. (ert-deftest test-ob-header-arg-defaults/tree/accumulate/call ()
  41. (should
  42. (equal "ge1/th2/th3/ge4/te5/--6"
  43. (org-test-at-id "1d97d258-fd50-4107-a095-e4625bffc57b"
  44. (org-babel-next-src-block 1)
  45. (forward-line -1)
  46. (org-babel-execute-src-block nil (org-babel-lob-get-info))))))
  47. (ert-deftest test-ob-header-arg-defaults/tree/accumulate/noweb ()
  48. (should
  49. (equal "ge1/th2/th3/ge4/te5/--6/--7/--8"
  50. (org-test-at-id "1d97d258-fd50-4107-a095-e4625bffc57b"
  51. (org-babel-next-src-block 1)
  52. (org-babel-execute-src-block)))))
  53. (ert-deftest test-ob-header-arg-defaults/tree/complex/call ()
  54. (should
  55. (equal "gh1/th2/--3/gh4/te5/--6"
  56. (org-test-at-id "fa0e912d-d9b4-47b0-9f9e-1cbb39f7cbc2"
  57. (org-babel-next-src-block 1)
  58. (forward-line -1)
  59. (org-babel-execute-src-block nil (org-babel-lob-get-info))))))
  60. (ert-deftest test-ob-header-arg-defaults/tree/complex/noweb ()
  61. (should
  62. (equal "gh1/th2/--3/gh4/te5/--6/--7/--8/--9"
  63. (org-test-at-id "fa0e912d-d9b4-47b0-9f9e-1cbb39f7cbc2"
  64. (org-babel-next-src-block 1)
  65. (org-babel-execute-src-block)))))
  66. (provide 'test-ob-header-arg-defaults)
  67. ;;; test-ob-header-arg-defaults.el ends here