xref: /sqlite-3.40.0/test/exec.test (revision 60a713c6)
1*60a713c6Sdrh# 2008 Jan 21
2*60a713c6Sdrh#
3*60a713c6Sdrh# The author disclaims copyright to this source code.  In place of
4*60a713c6Sdrh# a legal notice, here is a blessing:
5*60a713c6Sdrh#
6*60a713c6Sdrh#    May you do good and not evil.
7*60a713c6Sdrh#    May you find forgiveness for yourself and forgive others.
8*60a713c6Sdrh#    May you share freely, never taking more than you give.
9*60a713c6Sdrh#
10*60a713c6Sdrh#***********************************************************************
11*60a713c6Sdrh# This file implements regression tests for SQLite library.
12*60a713c6Sdrh#
13*60a713c6Sdrh# This file implements tests for the sqlite3_exec interface
14*60a713c6Sdrh#
15*60a713c6Sdrh# $Id: exec.test,v 1.1 2008/01/21 16:22:46 drh Exp $
16*60a713c6Sdrh
17*60a713c6Sdrhset testdir [file dirname $argv0]
18*60a713c6Sdrhsource $testdir/tester.tcl
19*60a713c6Sdrh
20*60a713c6Sdrhdo_test exec-1.1 {
21*60a713c6Sdrh  execsql {
22*60a713c6Sdrh    CREATE TABLE t1(a,b);
23*60a713c6Sdrh    INSERT INTO t1 VALUES(1,2);
24*60a713c6Sdrh    SELECT * FROM t1;
25*60a713c6Sdrh  }
26*60a713c6Sdrh} {1 2}
27*60a713c6Sdrhdo_test exec-1.2 {
28*60a713c6Sdrh  sqlite3_exec db {/* comment */;;; SELECT * FROM t1; /* comment */}
29*60a713c6Sdrh} {0 {a b 1 2}}
30*60a713c6Sdrhdo_test exec-1.3 {
31*60a713c6Sdrh  sqlite3 db2 test.db
32*60a713c6Sdrh  db2 eval {CREATE TABLE t2(x, y);}
33*60a713c6Sdrh  db2 close
34*60a713c6Sdrh  sqlite3_exec db {SELECT * FROM t1}
35*60a713c6Sdrh} {0 {a b 1 2}}
36*60a713c6Sdrh
37*60a713c6Sdrhfinish_test
38