org.texi: Overwrite with the one generated from "org-manual.org"
[org-mode/org-tableheadings.git] / testing / lisp / test-ob-sqlite.el
blobf73251534f65bd8fa431bc30e82308fc030e0fee
1 ;;; test-ob-sqlite.el --- tests for ob-sqlite.el
3 ;; Copyright (C) 2017 Eduardo Bellani
5 ;; Author: Eduardo Bellani <ebellani@gmail.com>
6 ;; Keywords: lisp
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 (org-test-for-executable "sqlite")
23 (unless (featurep 'ob-sqlite)
24 (signal 'missing-test-dependency "Support for sqlite code blocks"))
26 (ert-deftest ob-sqlite/table-variables-with-commas ()
27 "Test of a table variable that contains commas. This garantees that this code path results in a valid CSV."
28 (should
29 (equal '(("Mr Test A. Sql"
30 "Minister for Science, Eternal Happiness, and Finance"))
31 (org-test-with-temp-text
32 "#+name: test_table1
33 | \"Mr Test A. Sql\" | Minister for Science, Eternal Happiness, and Finance |
35 #+begin_src sqlite :db /tmp/test.db :var tb=test_table1
36 drop table if exists TestTable;
37 create table TestTable(person, job);
38 .mode csv TestTable
39 .import $tb TestTable
40 select * from TestTable;
41 #+end_src"
42 (org-babel-next-src-block)
43 (org-babel-execute-src-block)))))
45 ;;; test-ob-sqlite.el ends here