1 ;;; test-ob-perl.el --- tests for ob-perl.el
3 ;; Copyright (c) 2013 Achim Gratz
4 ;; Authors: Achim Gratz
6 ;; This file is not part of GNU Emacs.
8 ;; This program is free software; you can redistribute it and/or modify
9 ;; it under the terms of the GNU General Public License as published by
10 ;; the Free Software Foundation, either version 3 of the License, or
11 ;; (at your option) any later version.
13 ;; This program is distributed in the hope that it will be useful,
14 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
15 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 ;; GNU General Public License for more details.
18 ;; You should have received a copy of the GNU General Public License
19 ;; along with this program. If not, see <http://www.gnu.org/licenses/>.
22 (org-test-for-executable "perl")
23 (unless (featurep 'ob-perl
)
24 (signal 'missing-test-dependency
"Support for perl code blocks"))
26 (ert-deftest test-ob-perl
/simple-output
()
27 (org-test-with-temp-text "
28 #+header: :results output
30 print qq(Hi Mom!$/I'm home.);
32 (org-babel-next-src-block)
33 (should (equal "Hi Mom!\nI'm home."
34 (org-babel-execute-src-block)))))
36 (ert-deftest test-ob-perl
/simple-value
()
37 (org-test-with-temp-text "
38 #+header: :results value
40 qq(Hi Mom!$/I'm home.);
42 (org-babel-next-src-block)
43 (should (equal '(("Hi Mom!") ("I'm home."))
44 (org-babel-execute-src-block)))))
46 (ert-deftest test-ob-perl
/table-passthrough-colnames-nil
()
47 (org-test-with-temp-text "#+name: eg
53 #+header: :colnames nil
57 (org-babel-next-src-block)
58 (should (equal '(("col1" "col2") hline
("a" 1) ("b" 2.0))
59 (org-babel-execute-src-block)))))
61 (ert-deftest test-ob-perl
/table-passthrough-colnames-no
()
62 (org-test-with-temp-text "#+name: eg
68 #+header: :colnames no
72 (org-babel-next-src-block)
73 (should (equal '(("col1" "col2") ("a" 1) ("b" 2.0))
74 (org-babel-execute-src-block)))))
76 (provide 'test-ob-perl
)
78 ;;; test-ob-perl.el ends here