ox-rss.el: Fix keys descriptions in `org-export-define-derived-backend'
[org-mode.git] / testing / lisp / test-ob-C.el
blob4243bb6ae6b626b900a0fa1d2ce5c493d1b1ee83
1 ;;; test-ob-awk.el --- tests for ob-awk.el
3 ;; Copyright (c) 2010-2013 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 ;;; Code:
22 (unless (featurep 'ob-C)
23 (signal 'missing-test-dependency "Support for C code blocks"))
25 (ert-deftest ob-C/assert ()
26 (should t))
28 (ert-deftest ob-C/simple-program ()
29 "Hello world program."
30 (org-test-at-id "fa6db330-e960-4ea2-ac67-94bb845b8577"
31 (org-babel-next-src-block)
32 (should (= 42 (org-babel-execute-src-block)))))
34 (ert-deftest ob-C/integer-var ()
35 "Test of an integer variable."
36 (org-test-at-id "fa6db330-e960-4ea2-ac67-94bb845b8577"
37 (org-babel-next-src-block 2)
38 (should (= 12 (org-babel-execute-src-block)))))
40 (ert-deftest ob-C/two-integer-var ()
41 "Test of two input variables"
42 (org-test-at-id "fa6db330-e960-4ea2-ac67-94bb845b8577"
43 (org-babel-next-src-block 3)
44 (should (= 22 (org-babel-execute-src-block)))))
46 (ert-deftest ob-C/string-var ()
47 "Test of a string input variable"
48 (org-test-at-id "fa6db330-e960-4ea2-ac67-94bb845b8577"
49 (org-babel-next-src-block 4)
50 (should (equal "word 4" (org-babel-execute-src-block)))))
52 (ert-deftest ob-C/preprocessor ()
53 "Test of a string variable"
54 (org-test-at-id "fa6db330-e960-4ea2-ac67-94bb845b8577"
55 (org-babel-next-src-block 5)
56 (should (= 42 (org-babel-execute-src-block)))))
58 (ert-deftest ob-C/table ()
59 "Test of a table output"
60 :expected-result :failed
61 (org-test-at-id "2df1ab83-3fa3-462a-a1f3-3aef6044a874"
62 (org-babel-next-src-block)
63 (should (equal '((1) (2)) (org-babel-execute-src-block)))))
65 ;;; test-ob-C.el ends here