ob-ref: Small refactoring
[org-mode.git] / testing / lisp / test-ob-maxima.el
blob8af9c0d72c15a24077cf90b3e458f3246ff1fb51
1 ;;; test-ob-maxima.el --- tests for ob-maxima.el
3 ;; Copyright (c) 2010-2014 Sergey Litvinov
4 ;; Authors: Sergey Litvinov
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/>.
21 (org-test-for-executable "maxima")
22 (unless (featurep 'ob-maxima)
23 (signal 'missing-test-dependency "Support for Maxima code blocks"))
25 (ert-deftest ob-maxima/assert ()
26 (should t))
28 (ert-deftest ob-maxima/integer-input ()
29 "Test of integer input"
30 (org-test-at-id "b5842ed4-8e8b-4b18-a1c9-cef006b6a6c8"
31 (org-babel-next-src-block)
32 (should (equal 4 (org-babel-execute-src-block)))))
34 (ert-deftest ob-maxima/string-input ()
35 "Test of string input"
36 (org-test-at-id "b5842ed4-8e8b-4b18-a1c9-cef006b6a6c8"
37 (org-babel-next-src-block 2)
38 (should (equal "- sin(x)" (org-babel-execute-src-block)))))
40 (ert-deftest ob-maxima/simple-list-input ()
41 "Test of flat list input"
42 (org-test-at-id "b5561c6a-73cd-453a-ba5e-62ad84844de6"
43 (org-babel-next-src-block)
44 (should (equal "[1, 2, 3] " (org-babel-execute-src-block)))))
46 (ert-deftest ob-maxima/list-input ()
47 "Test of list input"
48 (org-test-at-id "b5561c6a-73cd-453a-ba5e-62ad84844de6"
49 (org-babel-next-src-block 2)
50 (should (equal "[2, [2, 3], 4] " (org-babel-execute-src-block)))))
52 (ert-deftest ob-maxima/table-input1 ()
53 "Test of table input"
54 (org-test-at-id "400ee228-6b12-44fd-8097-7986f0f0db43"
55 (org-babel-next-src-block)
56 (should (equal "[[2.0], [3.0]] " (org-babel-execute-src-block)))))
58 (ert-deftest ob-maxima/table-input2 ()
59 "Test of table input"
60 (org-test-at-id "400ee228-6b12-44fd-8097-7986f0f0db43"
61 (org-babel-next-src-block 2)
62 (should (equal "[[2.0, 3.0]] " (org-babel-execute-src-block)))))
64 (ert-deftest ob-maxima/matrix-output ()
65 "Test of table output"
66 (org-test-at-id "cc158527-b867-4b1d-8ae0-b8c713a90fd7"
67 (org-babel-next-src-block)
68 (should (equal '((1 2 3) (2 3 4) (3 4 5)) (org-babel-execute-src-block)))))
70 (provide 'test-ob-maxima)
72 ;;; test-ob-maxima.el ends here