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