1 ;;; test-ob-awk.el --- tests for ob-awk.el
3 ;; Copyright (c) 2010 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
9 (org-test-for-executable "awk")
11 (let ((load-path (cons (expand-file-name
12 ".." (file-name-directory
13 (or load-file-name buffer-file-name
)))
16 (require 'org-test-ob-consts
))
20 (ert-deftest ob-awk
/input-none
()
21 "Test with no input file"
22 (org-test-at-id "9e998b2a-3581-43fe-b26d-07d3c507b86a"
23 (org-babel-next-src-block)
24 (should (= 42 (org-babel-execute-src-block)))))
26 (ert-deftest ob-awk
/input-src-block
()
27 "Test a code block as an input"
28 (org-test-at-id "9e998b2a-3581-43fe-b26d-07d3c507b86a"
29 (org-babel-next-src-block 2)
30 (should (= 43 (org-babel-execute-src-block)))))
32 (ert-deftest ob-awk
/input-src-block
()
33 "Test a code block as an input"
34 (org-test-at-id "9e998b2a-3581-43fe-b26d-07d3c507b86a"
35 (org-babel-next-src-block 3)
36 (should (= 150 (org-babel-execute-src-block)))))