org-drill: prevent errors caused by attempting to display inline images on a non...
[org-mode/org-mode-NeilSmithlineMods.git] / testing / lisp / test-ob-maxima.el
blob4c92af0deee764803dc4890c2313c45d15cd23be
1 ;;; test-ob-maxima.el --- tests for ob-maxima.el
3 ;; Copyright (c) 2010-2012 Sergey Litvinov
4 ;; Authors: Sergey Litvinov
6 ;; Released under the GNU General Public License version 3
7 ;; see: http://www.gnu.org/licenses/gpl-3.0.html
8 (org-test-for-executable "maxima")
9 (unless (featurep 'ob-maxima)
10 (signal 'missing-test-dependency "Support for Maxima code blocks"))
12 (ert-deftest ob-maxima/assert ()
13 (should t))
15 (ert-deftest ob-maxima/integer-input ()
16 "Test of integer input"
17 (org-test-at-id "b5842ed4-8e8b-4b18-a1c9-cef006b6a6c8"
18 (org-babel-next-src-block)
19 (should (equal 4 (org-babel-execute-src-block)))))
21 (ert-deftest ob-maxima/string-input ()
22 "Test of string input"
23 (org-test-at-id "b5842ed4-8e8b-4b18-a1c9-cef006b6a6c8"
24 (org-babel-next-src-block 2)
25 (should (equal "- sin(x)" (org-babel-execute-src-block)))))
27 (ert-deftest ob-maxima/simple-list-input ()
28 "Test of flat list input"
29 (org-test-at-id "b5561c6a-73cd-453a-ba5e-62ad84844de6"
30 (org-babel-next-src-block)
31 (should (equal "[1, 2, 3] " (org-babel-execute-src-block)))))
33 (ert-deftest ob-maxima/list-input ()
34 "Test of list input"
35 (org-test-at-id "b5561c6a-73cd-453a-ba5e-62ad84844de6"
36 (org-babel-next-src-block 2)
37 (should (equal "[2, [2, 3], 4] " (org-babel-execute-src-block)))))
39 (ert-deftest ob-maxima/table-input1 ()
40 "Test of table input"
41 (org-test-at-id "400ee228-6b12-44fd-8097-7986f0f0db43"
42 (org-babel-next-src-block)
43 (should (equal "[[2.0], [3.0]] " (org-babel-execute-src-block)))))
45 (ert-deftest ob-maxima/table-input2 ()
46 "Test of table input"
47 (org-test-at-id "400ee228-6b12-44fd-8097-7986f0f0db43"
48 (org-babel-next-src-block 2)
49 (should (equal "[[2.0, 3.0]] " (org-babel-execute-src-block)))))
51 (ert-deftest ob-maxima/matrix-output ()
52 "Test of table output"
53 (org-test-at-id "cc158527-b867-4b1d-8ae0-b8c713a90fd7"
54 (org-babel-next-src-block)
55 (should (equal '((1 2 3) (2 3 4) (3 4 5)) (org-babel-execute-src-block)))))
57 (provide 'test-ob-maxima)
59 ;;; test-ob-maxima.el ends here