1 ;;; test-ob-octave.el --- tests for ob-octave.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 "octave")
9 (unless (featurep 'ob-octave
)
10 (signal 'missing-test-dependency
"Support for Octave code blocks"))
12 (ert-deftest ob-octave
/input-none
()
14 (org-test-at-id "54dcd61d-cf6c-4d7a-b9e5-854953c8a753"
15 (org-babel-next-src-block)
16 (should (= 10 (org-babel-execute-src-block)))))
18 (ert-deftest ob-octave
/output-vector
()
20 (org-test-at-id "54dcd61d-cf6c-4d7a-b9e5-854953c8a753"
21 (org-babel-next-src-block 2)
22 (should (equal '((1 2 3 4)) (org-babel-execute-src-block)))))
24 (ert-deftest ob-octave
/input-variable
()
26 (org-test-at-id "cc2d82bb-2ac0-45be-a0c8-d1463b86a3ba"
27 (org-babel-next-src-block)
28 (should (= 42 (org-babel-execute-src-block)))))
30 (ert-deftest ob-octave
/input-array
()
32 (org-test-at-id "cc2d82bb-2ac0-45be-a0c8-d1463b86a3ba"
33 (org-babel-next-src-block 2)
34 (should (equal '((1 2 3)) (org-babel-execute-src-block)))))
36 (ert-deftest ob-octave
/input-matrix
()
38 (org-test-at-id "cc2d82bb-2ac0-45be-a0c8-d1463b86a3ba"
39 (org-babel-next-src-block 3)
40 (should (equal '((1 2) (3 4)) (org-babel-execute-src-block)))))
42 (ert-deftest ob-octave
/input-string
()
44 (org-test-at-id "cc2d82bb-2ac0-45be-a0c8-d1463b86a3ba"
45 (org-babel-next-src-block 4)
46 (should (equal "te" (org-babel-execute-src-block)))))
48 (ert-deftest ob-octave
/input-nil
()
50 (org-test-at-id "cc2d82bb-2ac0-45be-a0c8-d1463b86a3ba"
51 (org-babel-next-src-block 5)
52 (should (equal nil
(org-babel-execute-src-block)))))